Embed Font in Flex4 Actionscript Project

A quick tip for all not seeing their embeded fonts when compiling pure AS project with Flex SDK 4:

[Embed(source="assets/fonts/my-cool-font.otf", fontFamily="CoolFont", fontWeight="normal", mimeType='application/x-font', embedAsCFF='false')]
private var MyCoolFont:Class;

Notice the embedAsCFF=’false’, this is the most important part. Basically when not using Spark Text Components (which are based on Text Layout Framework) you need this option.

In summary Halo Components or pure Actionscript Projects (TextField) need embedAsCFF=’false’ when embeding fonts in Flex4.

Be Sociable, Share!

Tags: , ,

7 Responses to “Embed Font in Flex4 Actionscript Project”

  1. GaryGeo Says:

    Thanks for this… the embedAsCFF was giving me problems.

  2. keithics Says:

    Thanks a lot!! I have been figuring out what in the world happened.

  3. Nikita Says:

    Thank you, you’ve just saved the day 😀
    Couldn’t figure out why my fonts disappeared, turns our that’s embedAsCFF…

  4. ugandhar Says:

    Thank you , you have just saved loft of time

  5. nantitv Says:

    Great post .
    Thnx dude.
    This font problem took my 2hr

  6. Mike Says:

    THANKS. Saved my life.

  7. Jason Says:

    Thanks! This was driving me insane.

Leave a Reply