Packageorg.aswing
Classpublic class ASFont
SubclassesASFontUIResource, EmptyFont

Font that specified the font name, size, style and whether or not embed.



Public Methods
 MethodDefined by
  
ASFont(name:String = "Tahoma", size:Number = 11, bold:Boolean = false, italic:Boolean = false, underline:Boolean = false, embedFontsOrAdvancedPros:* = null)
Create a font.
ASFont
  
apply(textField:TextField, beginIndex:int = -1, endIndex:int = -1):void
Applys the font to the specified text field.
ASFont
  
changeBold(bold:Boolean):ASFont
ASFont
  
changeItalic(italic:Boolean):ASFont
ASFont
  
changeName(name:String):ASFont
ASFont
  
changeSize(size:int):ASFont
ASFont
  
changeUnderline(underline:Boolean):ASFont
ASFont
  
computeTextSize(text:String, includeGutters:Boolean = true):IntDimension
Computes text size with this font.
ASFont
  
ASFont
  
getName():String
ASFont
  
getSize():uint
ASFont
  
getTextFormat():TextFormat
Return a new text format that contains the font properties.
ASFont
  
isBold():Boolean
ASFont
  
isEmbedFonts():Boolean
ASFont
  
isItalic():Boolean
ASFont
  
isUnderline():Boolean
ASFont
  
toString():String
ASFont
Constructor detail
ASFont()constructor
public function ASFont(name:String = "Tahoma", size:Number = 11, bold:Boolean = false, italic:Boolean = false, underline:Boolean = false, embedFontsOrAdvancedPros:* = null)

Create a font.

Parameters
name:String (default = "Tahoma") — a boolean to indicate whether or not embedFonts or a ASFontAdvProperties instance.
 
size:Number (default = 11)
 
bold:Boolean (default = false)
 
italic:Boolean (default = false)
 
underline:Boolean (default = false)
 
embedFontsOrAdvancedPros:* (default = null)

See also

Method detail
apply()method
public function apply(textField:TextField, beginIndex:int = -1, endIndex:int = -1):void

Applys the font to the specified text field.

Parameters
textField:TextField — the text filed to be applied font.
 
beginIndex:int (default = -1) — The zero-based index position specifying the first character of the desired range of text.
 
endIndex:int (default = -1) — The zero-based index position specifying the last character of the desired range of text.
changeBold()method 
public function changeBold(bold:Boolean):ASFontParameters
bold:Boolean

Returns
ASFont
changeItalic()method 
public function changeItalic(italic:Boolean):ASFontParameters
italic:Boolean

Returns
ASFont
changeName()method 
public function changeName(name:String):ASFontParameters
name:String

Returns
ASFont
changeSize()method 
public function changeSize(size:int):ASFontParameters
size:int

Returns
ASFont
changeUnderline()method 
public function changeUnderline(underline:Boolean):ASFontParameters
underline:Boolean

Returns
ASFont
computeTextSize()method 
public function computeTextSize(text:String, includeGutters:Boolean = true):IntDimension

Computes text size with this font.

Parameters
text:String — the text to be compute
 
includeGutters:Boolean (default = true)

Returns
IntDimension — the computed size of the text

See also

getAdvancedProperties()method 
public function getAdvancedProperties():ASFontAdvProperties

Returns
ASFontAdvProperties
getName()method 
public function getName():String

Returns
String
getSize()method 
public function getSize():uint

Returns
uint
getTextFormat()method 
public function getTextFormat():TextFormat

Return a new text format that contains the font properties.

Returns
TextFormat — a new text format.
isBold()method 
public function isBold():Boolean

Returns
Boolean
isEmbedFonts()method 
public function isEmbedFonts():Boolean

Returns
Boolean
isItalic()method 
public function isItalic():Boolean

Returns
Boolean
isUnderline()method 
public function isUnderline():Boolean

Returns
Boolean
toString()method 
public function toString():String

Returns
String