Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Well, you'll some how have to know what language you're loading. Autodetection can be quite difficult.</p> <p>Assuming you know what language the content is you can register fonts to be used in runtime using <a href="http://livedocs.adobe.com/flex/3/langref/flash/text/Font.html#registerFont()" rel="nofollow noreferrer">Font.registerFont()</a>; With this you can load a swf that contains a font, register it, and it's available for future use in all textfields. print("code sample");</p> <pre><code>[Embed(src="someFont.ttf", fontFamily="myFont", mimeType="application/x-font")] private var fontClass:Class; ... Font.registerFont(fontClass); </code></pre> <p>Note that you'll have to compile using the flex compiler to support the Embed tag.</p> <p>A good utility in addition is <a href="http://livedocs.adobe.com/flex/3/langref/flash/text/Font.html#hasGlyphs()" rel="nofollow noreferrer">Font.hasGlyphs()</a>, which you can use to check if the characters you are using are available in an embedded fonts. This can be used to either jump back to a system font or display a warning to you as the developer (if you forgot some characters or whatever). Subclassing TextField to do this check automatically may be a good idea.</p> <p>If this is going to be online, in general embedding Chinese is something you should think about twice. Embedding all characters will increase the filesize <strong>a lot</strong> and afaik there aren't that many complete Chinese fonts available anyway. The technique above is of course still useful for many other languages.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload