How to: embed dfont fonts on OS X in Adobe Flex and AIR apps
If you're on a Mac, you cannot embed fonts in Flex or AIR apps directly from the dfont files that come with the system. However, you can do this:
- Install fondu (
sudo port install fondu
or get the OS X package) - Copy the fonts you want to convert from /System/Fonts to, say, ~/mydfonts
- Switch the output folder (e.g.,
cd ~/mynewfonts
) - In Terminal, invoke fondu (
fondu ~/mydfonts/*.dfont
) - In your Flex Builder project properties, add the following compiler tag:
-managers flash.fonts.AFEFontManager
(or else you'll get an exception during transcoding: Unexpected exception encountered while reading font file error) - Finally, embed the font as you would normally via CSS. e.g.,
@font-face { src: url("fonts/Geneva.ttf") ; font-family: "GenevaAIR"; advanced-anti-aliasing: true; }
Comments
by Matt Giger on 2009-01-16 21:24:10
by funkyboy on 2009-01-22 10:36:51
by Brooks on 2009-02-20 14:54:47
by Robin on 2009-05-06 19:49:22
by Alastair on 2011-09-19 16:39:16