Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 27. Text Display and Input > Determining Font Availability

27.6. Determining Font Availability

To determine the list of device fonts and embedded fonts available at runtime, use the Font class's static method enumerateFonts( ). The enumerateFonts( ) method returns an array of Font objects, each of which represents an available device font or embedded font. The enumerateFonts( ) method defines a single Boolean parameter, enumerateDeviceFonts, which dictates whether the returned array includes device fonts. By default, enumerateDeviceFonts is false, so the array returned by enumerateFonts( ) does not include device fonts. Each Font object in the returned array defines the following variables describing the font it represents:


fontName

Indicates the name of the font. For device fonts, fontName is the name that appears in the system font list. For fonts embedded in the Flash authoring tool, fontName is the name that appears in the Font menu of the Font Symbol Properties dialog box used to embed the font. For fonts embedded using the [Embed] metadata tag, fontName is the string value specified for the fontFamily parameter of the [Embed] tag used to embed the font.


fontStyle

Indicates the font variation (regular, bold, italic, or bold-italic) as one of the following four ActionScript constants: FontStyle.REGULAR, FontStyle.BOLD, FontStyle.ITALIC, FontStyle.BOLD_ITALIC.


fontType

Indicates whether the font is an embedded font or a device font. This variable refers to one of the following two ActionScript constants: FontType.EMBEDDED, or FontType.DEVICE.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial