As usual in flash games developers use special fonts. This fonts looks cool and exciting but exist one problem. A lot of users don’t has this fonts on their PC. And when they play in game they see not cool font and arial or something else what exist in their font library. So the main goal of this post to show cool font for game and any user who will use this game will see your cool and exciting font(even if player don’t have this font on his PC).
So open Flash IDE and create dynamic font.

In properties must be like on this pic:

In library create new font and on property must be like on this pic:

Now need create .as file with next code:

You can copy paste this code:
package
{
import flash.display.MovieClip;
import flash.text.TextFormat;
import flash.text.TextFieldAutoSize;
import flash.text.AntiAliasType;
import flash.text.Font;
public class EmbedText extends MovieClip
{
public function EmbedText()
{
var myNumber:Number = 5;
var fooFont:Font = new foo();
var format:TextFormat = new TextFormat();
format.font=fooFont.fontName;
format.color=0x333333;
//format.size = 100;
//levelNumbers.height += 100;
levelNumbers.embedFonts=true;
levelNumbers.autoSize = TextFieldAutoSize.CENTER;
levelNumbers.antiAliasType=AntiAliasType.ADVANCED;
levelNumbers.defaultTextFormat = format;
levelNumbers.text = String(myNumber);
}
}
}
Don’t forgot to add class name to your main .fla document:

Source file you can find on the end of this post.
So now every user will see your cool font.
Enjoy Flashing:)
Source:
Font Embedding
