Embedding a font in Flex has been improved in Flex 4 and it can be a powerful tool for customizing your application, however using fonts can quickly increase the size of your swf.
A great and easy way to reduce this impact is to limit the character set embedded. There are a few places you could do this, but I find it easiest to do in CSS.
So I promised Ed I'd get a recipe up by today, and although this is a pretty simple solution, it can save a lot of space when you are embedding fonts.
In your css file use
@font-face to embed a font and make it accessible
throughout your application.
Note: The font file used in this sample is not included in the attachment since I don't want to get in trouble for distributing it, but you can find it here.
@font-face {
src: url("assets/fonts/Fertigo_PRO.otf");
fontFamily: Fertigo;
fontStyle: normal;
fontWeight: normal;
advancedAntiAliasing: true;
cff:true;
unicodeRange:
U+0041-005A, /* Upper-Case [A..Z] */
U+0061-007A, /* Lower-Case a-z */
U+0030-0034, /* Numbers [0..4] */
U+002E-002E; /* Period [.] */
}
+