Package | com.ghostwire.ui.managers |
Class | public class uiFonts |
Inheritance | uiFonts ![]() |
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 ~
Property | Defined 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 |
Method | Defined by | ||
---|---|---|---|
load(asset:String = ""):void
Initiates the loading of one or more external font asset(s).
| uiFonts |
Event | Summary | Defined 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 |
fileExt | property |
public var fileExt:String = ".swf"
Indicates the file extension of the external font assets.
The default value is .swf
.
manager | property |
manager:uiFonts
[read-only]
Indicates the shared instance of the uiFonts
singleton class.
public static function get manager():uiFonts
path | property |
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
progress | property |
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.
public function get progress():Number
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; }
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
complete | event |
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.
progress | event |
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:
Property | Value |
---|---|
bubbles | false |
bytesLoaded | The accumulated number of bytes loaded at the time the listener processes the event. |
bytesTotal | The total number of bytes that will ultimately be loaded if the loading process completes successfully. |
cancelable | false ; there is no default behavior to cancel. |
currentTarget | The object that is actively processing the Event object with an event listener. |
target | The network object reporting progress. |