Embedding Fonts Using Flash Builder 4

3
Sep/09
7

Not too long ago, I struggled with embedding fonts in my AS3 app that I build with Ant. Building my .swfs with Ant has been my practice for quite a while but embedding fonts wasn’t. It took some time but I finally figured it out. Everything was fine until I tried to build using Flash Builder which kept reporting transcoding errors.

So how do you enable proper transcoding of fonts in Flash Builder? Add the following to your compiler options.

-managers flash.fonts.AFEFontManager

If this doesn’t work, let me know. Docs on embedding fonts seems to be in short supply so I’d like to collect as much information as possible.

Filed under: flash
Comments (7) Trackbacks (0)
  1. Matthew Horn
    1:59 pm on September 10th, 2009

    Thanks for the follow up on this, Phil. I just now read your previous post on the subject of ant and fonts, and have added it to my “to do” list for Flex 4. I also added a link to your blog from the livedocs page that you referenced, so hopefully other users will not have to go through the same problems.

    Matthew Horn
    Flex docs

  2. Phil
    8:49 pm on September 10th, 2009

    And thank you for reminding me that I should be posting comments in the livedocs instead of shouting into the void.

  3. Robert
    1:48 pm on February 8th, 2010

    Thanks for posting this, a whole day of frustration solved.

  4. Mihai Alexandru Bîrsan
    7:31 am on March 16th, 2010

    Thank you! This worked wonders!

  5. Alison
    7:22 am on March 30th, 2010

    Hi – I was wondering does this work with Flex Builder 3 with flex 4.0.0.14159 sdk. I downloaded this version and added it to my sdks folder in FlexBuilder 3.

    I ensured that Flex was pointing to it and the player was set to 10 0 0. I also checked textlayout.swc, framework.swc etc was included in library path in Flex.

    I then tried to build my project which makes use of font embedding – I noticed that on some forums people mentioned to change cff=”true” to embedAsCFF=”true” which I did which got rid of one error. However I keep getting a Verify Error:FontAsset not found. Even though this class resides in these included swcs. I tried the beta release downloads also and they dont work either.

    The last version I had of the sdk was 4.0.0 build 7219 and it worked fine. Has something else changed regarding font embedding or is there a bug with these new releases and Flash Builder 3???

    [

    Embed( source="D:/deployment/applications/fontbuilder/fonts/arial bold.ttf",
    fontWeight=

    "bold",
    fontFamily=

    "ArialCFF",
    mimeType=

    "application/x-font",
    unicodeRange=

    "U+0030-U+0039,U+0009,U+000A,U+000D,U+0020-U+0023,U+0025-U+002F,U+003A-U+0040,U+ 005B-U+0060,U+007B-U+007E,U+00A9,U+0024,U+00A2,U+00A3,U+20AC,U+0041-U+005A,U+006 1-U+007A,U+00A0-U+00FF,U+0100-U+017F,U+0180-U+024F,U+0391-U+03CE",

    embedAsCFF="true" /*needed for latest SDK */

    )]

  6. nail84
    11:03 am on May 6th, 2010

    I didn’t see any letters, until I set embedAsCFF=”false”. Maybe this could help someone.

  7. joe
    4:15 pm on July 26th, 2010

    embedAsCFF=”false” – that helped a lot, thanks! 4 hours of trouble finally have an end…

Leave a comment

No trackbacks yet.