home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
404 Jogos
/
CLJG.iso
/
Puzzle
/
filler.swf
/
scripts
/
mx
/
core
/
UITextFormat.as
< prev
Wrap
Text File
|
2008-09-02
|
3KB
|
109 lines
package mx.core
{
import flash.text.TextField;
import flash.text.TextFormat;
import flash.text.TextLineMetrics;
import mx.managers.ISystemManager;
use namespace mx_internal;
public class UITextFormat extends TextFormat
{
mx_internal static const VERSION:String = "2.0.1.0";
private static var measurementTextField:TextField;
public var sharpness:Number;
public var gridFitType:String;
public var antiAliasType:String;
public var thickness:Number;
private var systemManager:ISystemManager;
public function UITextFormat(param1:ISystemManager, param2:String = null, param3:Object = null, param4:Object = null, param5:Object = null, param6:Object = null, param7:Object = null, param8:String = null, param9:String = null, param10:String = null, param11:Object = null, param12:Object = null, param13:Object = null, param14:Object = null)
{
this.systemManager = param1;
super(param2,param3,param4,param5,param6,param7,param8,param9,param10,param11,param12,param13,param14);
}
public function measureText(param1:String) : TextLineMetrics
{
return measure(param1,false);
}
mx_internal function copyFrom(param1:TextFormat) : void
{
font = param1.font;
size = param1.size;
color = param1.color;
bold = param1.bold;
italic = param1.italic;
underline = param1.underline;
url = param1.url;
target = param1.target;
align = param1.align;
leftMargin = param1.leftMargin;
rightMargin = param1.rightMargin;
indent = param1.indent;
leading = param1.leading;
}
public function measureHTMLText(param1:String) : TextLineMetrics
{
return measure(param1,true);
}
private function measure(param1:String, param2:Boolean) : TextLineMetrics
{
var _loc3_:ISystemManager = null;
var _loc4_:TextLineMetrics = null;
if(!param1)
{
param1 = "";
}
if(!measurementTextField)
{
measurementTextField = new TextField();
}
if(param2)
{
measurementTextField.htmlText = "";
}
else
{
measurementTextField.text = "";
}
measurementTextField.defaultTextFormat = this;
_loc3_ = systemManager;
if(font)
{
measurementTextField.embedFonts = _loc3_ != null && _loc3_.isFontFaceEmbedded(this);
}
else
{
measurementTextField.embedFonts = false;
}
measurementTextField.antiAliasType = antiAliasType;
measurementTextField.gridFitType = gridFitType;
measurementTextField.sharpness = sharpness;
measurementTextField.thickness = thickness;
if(param2)
{
measurementTextField.htmlText = param1;
}
else
{
measurementTextField.text = param1;
}
(_loc4_ = measurementTextField.getLineMetrics(0)).width = Math.ceil(_loc4_.width);
_loc4_.height = Math.ceil(_loc4_.height);
return _loc4_;
}
}
}