Packageimpression.persistence.properties
Classpublic class FontData
InheritanceFontData Inheritance Object

The FontData object stores basic information about a given font.



Public Properties
 PropertyDefined By
  bold : Boolean = false
The font's bold state.
FontData
  dpi : Number = 96
[static] The value that all FontData objects will use when calculating the size of the font in pixels.
FontData
  emSize : Number = 10
The em size (or point size) of the font.
FontData
  familyName : String = Arial
The family name of the font (for instance, Arial).
FontData
  italic : Boolean = false
The font's italic state.
FontData
  pixelSize : Number
[read-only] The recommended pixel size of the object.
FontData
  underline : Boolean = false
The font's underline state.
FontData
Public Methods
 MethodDefined By
  
FontData(familyName:String, emSize:Number, bold:Boolean = false, italic:Boolean = false, underline:Boolean = false)
Creates a new instance of the FontData class.
FontData
  
Returns a copy of the object.
FontData
  
fromObject(source:Object):FontData
[static] Returns a new instance of the FontData class based on the data contained in the object.
FontData
  
fromXML(source:XML):FontData
[static] Returns a new instance of the FontData class based on the data contained in the XML object.
FontData
  
pointSizeToPixelSize(pointSize:Number):Number
[static] Returns a number indicating the recommended pixel size for a given point size (or emSize).
FontData
  
toObject():Object
Returns an Object containing the property values as dynamic properties.
FontData
  
toString():String
Returns a string describing the object.
FontData
Property Detail
boldproperty
public var bold:Boolean = false

The font's bold state.

The default value is false.

dpiproperty 
public static var dpi:Number = 96

The value that all FontData objects will use when calculating the size of the font in pixels.

The default value is 96.

emSizeproperty 
public var emSize:Number = 10

The em size (or point size) of the font.

The default value is 10.

familyNameproperty 
public var familyName:String = Arial

The family name of the font (for instance, Arial).

The default value is Arial.

italicproperty 
public var italic:Boolean = false

The font's italic state.

The default value is false.

pixelSizeproperty 
pixelSize:Number  [read-only]

The recommended pixel size of the object.


Implementation
    public function get pixelSize():Number

See also

underlineproperty 
public var underline:Boolean = false

The font's underline state.

The default value is false.

Constructor Detail
FontData()Constructor
public function FontData(familyName:String, emSize:Number, bold:Boolean = false, italic:Boolean = false, underline:Boolean = false)

Creates a new instance of the FontData class.

If any parameter is missing, the default value is used.

Parameters
familyName:String — The family name of the font (for instance, Arial).
 
emSize:Number — The em size (or point size) of the font.
 
bold:Boolean (default = false) — The font's bold state.
 
italic:Boolean (default = false) — The font's italic state.
 
underline:Boolean (default = false) — The font's underline state.

See also

Method Detail
clone()method
public function clone():FontData

Returns a copy of the object.

Returns
FontData — A copy of the object.
fromObject()method 
public static function fromObject(source:Object):FontData

Returns a new instance of the FontData class based on the data contained in the object.

If souve is null an empty FontData object is returned.

Parameters

source:Object — The object containing the data to use. The object should contain five dynamic properties, familyName, emSize, bold, italic, and underline.

Returns
FontData — A new instance of the FontData class containing the data from the source Object.
fromXML()method 
public static function fromXML(source:XML):FontData

Returns a new instance of the FontData class based on the data contained in the XML object.

If source is null then a FontData object with default values is returned. The XML format of a FontData object is:

If any attribute is missing, the default value is used.

Parameters

source:XML — The object containing the data to use.

Returns
FontData — A FontData object containing the data from the source XML object.
pointSizeToPixelSize()method 
public static function pointSizeToPixelSize(pointSize:Number):Number

Returns a number indicating the recommended pixel size for a given point size (or emSize).

Parameters

pointSize:Number — The point size/emSize to calculat the pixel size of.

Returns
Number — The recommended pixel size.

See also

toObject()method 
public function toObject():Object

Returns an Object containing the property values as dynamic properties.

Returns
Object — An Object containing the property values as dynamic properties.
toString()method 
public function toString():String

Returns a string describing the object.

Returns
String — A string describing the object.