Packagech.capi.display.text
Classpublic class FontsManager

Manages the registered Font. Within this class, the Font registration is very easy : Just create your font symbol into the library, set it a linkage (the base class must be or extends ch.capi.display.text.AbstractFont) and then simply do the following :
  //register the font
  var ab:AbstractFont = FontsManager.register("myFontClass", "linkageName");
  
  //retrieves the font
  var ft:AbstractFont = FontsManager.getFont("linkageName");
  
Note that this class is design to totally encapsulate the Font class. If you use this class, you shouldn't use the Font class methods.

See also

FontsParser
AbstractFont


Public Methods
 MethodDefined by
  
[static] Retrieves the linkage names available.
FontsManager
  
getFont(linkageName:String):AbstractFont
[static] Retrieves the AbstractFont registered under the specified linkageName.
FontsManager
  
isFontAvailable(fontName:String):String
[static] Retrieves the type of a font.
FontsManager
  
isRegistered(linkageName:String):Boolean
[static] Defines if the specified linkage name is already linked.
FontsManager
  
register(classPath:String, linkageName:String):AbstractFont
[static] Register a class as a Font.
FontsManager
Public Constants
 ConstantDefined by
  DEVICE_FONT : String = "deviceFont"
[static] Defines a font as a device font.
FontsManager
  FONT_EMBEDDED : String = "embeddedFont"
[static] Defines a font as an embedded font.
FontsManager
  FONT_NOT_AVAILABLE : String = "fontNotAvailable"
[static] Defines a font that is not available.
FontsManager
Method detail
enumerateLinkages()method
public static function enumerateLinkages():Array

Retrieves the linkage names available.

Returns
Array — An Array containing all the available linkage names.
getFont()method 
public static function getFont(linkageName:String):AbstractFont

Retrieves the AbstractFont registered under the specified linkageName.

Parameters
linkageName:String — the linkage name.

Returns
AbstractFont — The corresponding AbstractFont.
isFontAvailable()method 
public static function isFontAvailable(fontName:String):String

Retrieves the type of a font.

Parameters
fontName:String — The name of the font.

Returns
String — The type of the font issued from the constants.

See also

isRegistered()method 
public static function isRegistered(linkageName:String):Boolean

Defines if the specified linkage name is already linked.

Parameters
linkageName:String — The linkage name.

Returns
Booleantrue if the linkage is already linked.
register()method 
public static function register(classPath:String, linkageName:String):AbstractFont

Register a class as a Font. As the retrieving of the AbstractFont object is based on the check of the classPath it is important that each of the registered font class extends the AbstractFont class.

Parameters
classPath:String — The full class name that will be registered. This class must extend the AbstractFont class !
 
linkageName:String — The linkage name.

Returns
AbstractFont — The AbstractFont created.

Throws
NameAlreadyExistsError — If the linkage name is already used.
Constant detail
DEVICE_FONTconstant
public static const DEVICE_FONT:String = "deviceFont"

Defines a font as a device font.

See also

FONT_EMBEDDEDconstant 
public static const FONT_EMBEDDED:String = "embeddedFont"

Defines a font as an embedded font.

See also

FONT_NOT_AVAILABLEconstant 
public static const FONT_NOT_AVAILABLE:String = "fontNotAvailable"

Defines a font that is not available.

See also