Packagecom.ghostwire.ui.managers
Classpublic class uiFonts
InheritanceuiFonts Inheritance flash.events.EventDispatcher

The uiFonts manager manages the use of embedded fonts loaded into the application via external SWF files during run-time.

The use of this manager makes it possible to use embedded fonts without compiling/embedding them into the application SWF. Instead, each individual font exists in its own external SWF file which can be loaded into the application “on demand” during run-time.

uiFonts cannot be instantiated via the new operator. To access the singleton instance, use uiFonts.manager.

For instructions on how to compile Font SWFs, please refer to the documentation at
http://ghostwire.com/aspireui/docs/usage/uifonts

~ This class is available in Aspire UI Components Standard Edition ~



Public Properties
 PropertyDefined by
  fileExt : String = ".swf"
Indicates the file extension of the external font assets.
uiFonts
  manager : uiFonts
[static][read-only] Indicates the shared instance of the uiFonts singleton class.
uiFonts
  path : String = "assets/fonts/"
Indicates the path to the folder containing external font assets.
uiFonts
  progress : Number
[read-only] Indicates the loading progress of external font files.
uiFonts
Public Methods
 MethodDefined by
  
load(asset:String = ""):void
Initiates the loading of one or more external font asset(s).
uiFonts
Events
 EventSummaryDefined by
   Dispatched when all font assets in the loading queue have been loaded.uiFonts
   Dispatched when data is received as the download of font assets progresses.uiFonts
Property detail
fileExtproperty
public var fileExt:String = ".swf"

Indicates the file extension of the external font assets.

The default value is .swf.

managerproperty 
manager:uiFonts  [read-only]

Indicates the shared instance of the uiFonts singleton class.

Implementation
    public static function get manager():uiFonts
pathproperty 
public var path:String = "assets/fonts/"

Indicates the path to the folder containing external font assets. The string value must end with a trailing slash.

Note: changing this value in the middle of an application does not affect loaded assets.

See also

progressproperty 
progress:Number  [read-only]

Indicates the loading progress of external font files. The value returned is a number between 0.0 (zero progress) and 1.0 (loading completed).

You would typically listen to the ProgressEvent.PROGRESS event and query this property.

Implementation
    public function get progress():Number
Method detail
load()method
public function load(asset:String = ""):void

Initiates the loading of one or more external font asset(s). Specify the name(s) of the font(s), not the path(s) or file name(s). You may specify multiple fonts by using a comma-delimited string.

Note: the font asset file must be named after the font itself, replacing any space with underscore. For example, the font "Comic Sans MS" should have its font asset file named as "Comic_Sans_MS.swf".

The path to the assets is defined by the property path.

Once a font asset is loaded, the text styles using the font will be invalidated automatically.

If you call this method without passing any parameter, the manager will begin the loading of external font assets once the uiTextStyles manager has finished loading its CSS text styles file (typically "text.css" in the theme folder). The list of font assets to load must be defined in the CSS file. For example, to have the manager automatically load the Arial, Comic Sans MS and Verdana font assets, you would specify in the "text.css" as follows:

    @load
    {
     fonts:Arial,Comic Sans MS,Verdana;
    }
The font assets must be stored in "assets/fonts/" folder and named "Arial.swf", "Comic_Sans_MS.swf" and "Verdana.swf", respectively.

Parameters
asset:String (default = "") — A String value indicating the asset(s) to load. Specify the name(s) of the font(s), not the paths or the file names. You may specify multiple assets by using a comma-delimited string, eg. "Arial Unicode MS,Comic Sans MS,Tahoma".

See also

Event detail
completeevent 
Event object type: flash.events.Event

Dispatched when all font assets in the loading queue have been loaded.

Note that once a font asset is loaded, the text styles using the font will be invalidated automatically. Therefore, you should not normally need to listen to this event. It is however useful if you wish to delay certain application code until the font assets are loaded.

progressevent  
Event object type: flash.events.ProgressEvent.PROGRESS

Dispatched when data is received as the download of font assets progresses. You can listen to this event and track the download progress.

This event has the following properties:

PropertyValue
bubblesfalse
bytesLoadedThe accumulated number of bytes loaded at the time the listener processes the event.
bytesTotalThe total number of bytes that will ultimately be loaded if the loading process completes successfully.
cancelablefalse; there is no default behavior to cancel.
currentTargetThe object that is actively processing the Event object with an event listener.
targetThe network object reporting progress.