Embedded Fonts in Modules

A question was asked on Flexcoders about how to use embedded fonts in modules and late-load the embedded font. This example, inspired by Jonas.Eliasson, shows how it can be done.
Note that this example expects you to have an assets folder with arial.ttf and arialbd.ttf which I did not put in the zip because most of you have it somewhere, and I think it may be illegal to ship a .ttf across state lines.
Download file

5 Responses to Embedded Fonts in Modules

  1. jonas eliasson says:

    Hey nice example. I found that if I want to use other fonts types than ttf I have to point to a SWF with the fonts emedded instead. As Flex seems to only support ttf fonts, true?

  2. Brad Martin says:

    So does a .swf file need to be generated for the font in order to use embedded fonts in a module?
    —————
    Not if you’re using 2.0.1. It can handle truetype fonts directly. Opentype and other fonts require a swf.

  3. alimills says:

    Alex,
    Nice example. Thanks!
    I modified it to work through an issue I was having where embedded fonts weren’t being picked up by loaded modules.
    I talk about my problem and share the solution with your modified code at http://www.asserttrue.com.
    Thanks again!
    Ali

  4. Scott says:

    Hi, Do you have tips/experience in using Modules and using some images that are common to all Modules and will be embedded (rather than linked)? I’d like to be able to have a few separate Modules but all the Modules would share some images and they would be embedded in each Module but I don’t want to have to duplicate an “images” directory for every Module. Is there a way to have one common images dir and still use Modules and still use embedding for the images in each Module ?
    Thanks for any help
    ——————
    Haven’t actually done it, but it is like the shared code problem. I would put all embeds in a module and load that module first, then other modules get their images from that module. The key is to put the shared image module in a variable that other modules can use to find it.