| Flex 2 Developer's Guide > Customizing the User Interface > Using Fonts > Using embedded fonts > Locating embedded fonts | |||
The src attribute in the @font-face declaration specifies the location of the fontFamily. You can specify a url or a local function. The following table describes these functions:
|
Attribute |
Description |
|---|---|
url
|
Embeds a TrueType font by location by specifying a valid URI to the font. The URI can be relative (for example, ../fontfolder/akbar.ttf) or absolute (for example, c:/myfonts/akbar.ttf). |
local
|
Embeds a locally accessible TrueType font by name rather than location. You use the font name, and not the filename, for the font. For example, you specify "Akbar Bold Italic" rather than "AkbarBI.ttf". You can embed fonts that are locally accessible by the application server's Java Runtime Environment (JRE). These fonts include the *.ttf files in the jre/lib/fonts folder, fonts that are mapped in the jre/lib/font.properties file, and fonts that are made available to the JRE by the operating system (OS). On Windows, TTF files in the /windows/fonts directory (or /winnt/fonts) are available to the local function. On Solaris or Linux, fonts that are registered with a font server, such as xfs, are available. The font name that you specify is determined by the operating system. In general, you do not include the font file's extension, but this is OS-dependent. For more information, consult your operating system documentation. |
You must specify the url or local function of the src descriptor in the @font-face declaration. All other descriptors are optional. In general, you should use url rather than local, because pointing to a file is more reliable than using a reference controlled by the operating system.
Do not mix embedded and nonembedded fonts in the same fontFamily descriptor.
Flex 2.01