Package | impression.persistence.properties |
Class | public class FontData |
Inheritance | FontData ![]() |
Property | Defined 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 |
Method | Defined 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 | ||
[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 |
bold | property |
public var bold:Boolean = false
The font's bold state.
The default value is false
.
dpi | property |
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
.
emSize | property |
public var emSize:Number = 10
The em size (or point size) of the font.
The default value is 10
.
familyName | property |
public var familyName:String = Arial
The family name of the font (for instance, Arial).
The default value is Arial
.
italic | property |
public var italic:Boolean = false
The font's italic state.
The default value is false
.
pixelSize | property |
pixelSize:Number
[read-only] The recommended pixel size of the object.
public function get pixelSize():Number
See also
underline | property |
public var underline:Boolean = false
The font's underline state.
The default value is false
.
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.
ParametersfamilyName: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
clone | () | method |
public function clone():FontData
Returns a copy of the object.
ReturnsFontData — 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 .
|
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.
|
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.
|
Number — The recommended pixel size.
|
See also
toObject | () | method |
public function toObject():Object
Returns an Object containing the property values as dynamic properties.
ReturnsObject — An Object containing the property values as dynamic properties.
|
toString | () | method |
public function toString():String
Returns a string describing the object.
ReturnsString — A string describing the object.
|