The problem of embedding a font and its correct display in Flash

I'm looking for the right text box options or workaround for my last issue with Flash fonts and text fields.

I have textFormat and textField to generate some text using the font Font: Franklin Gothic Book size 8. Now the font will look like this when the movie starts:

alt text
(source: flickr.com )

The bottom of ®MYLOGO is Photoshop's jpg, clean and how it should look. This is followed by the font directly typed on the scene in Flash, and the topmost ®MYLOGO is generated from my code.

What options am I missing so that the copy generated by the code looks as close as possible to Jpeg?

My code is below:

var tsFont = new TextFormat(); tsFont.font = FranklinGothic; tsFont.size = 8; tsFont.color = 0xFFFFFF; tsFont.align = TextFormatAlign.LEFT; var tsLogo:TextField = new TextField(); tsLogo.defaultTextFormat = tsFont; tsLogo.selectable = false; tsLogo.mouseEnabled = false; tsLogo.x = 18; tsLogo.y = 98; tsLogo.width = 64; tsLogo.height = 16; tsLogo.text = "®MYLOGO"; addChild(tsLogo); 

You guys remember this code from my last question X_x


MAIN WORKING KERNEL: thanks Andy Lee

 var tsFont = new TextFormat(); tsFont.font = (new FranklinGothic() as Font).fontName; tsFont.size = 8; tsFont.color = 0xFFFFFF; tsFont.align = TextFormatAlign.LEFT; var tsLogo:TextField = new TextField(); tsLogo.selectable = false; tsLogo.mouseEnabled = false; tsLogo.embedFonts = true; tsLogo.antiAliasType = flash.text.AntiAliasType.NORMAL; tsLogo.gridFitType = "pixel"; tsLogo.sharpness = 400 tsLogo.x = 6; tsLogo.y = 5; tsLogo.width = 600; tsLogo.height = 40; tsLogo.text = "®MYLOGO"; tsLogo.setTextFormat(tsFont) 

Graphic examples:

NORMAL

alt text

ADVANCED

alt text

+4
source share
3 answers

Controlling text playback in Flash is sometimes painful ...

You need to play with several properties: antiAliasType , gridFitType , sharpness , thickness TextField . Try Adobe Sample . Or an even more detailed guide .

+2
source

Try adding this code:

tsLogo.antiAliasType = flash.text.AntiAliasType.NORMAL;

or

tsLogo.antiAliasType = flash.text.AntiAliasType.ADVANCED;

+2
source

Yes, make sure you check Aliasing, but if it is not, I would try calling:

 tsLogo.setTextFormat(tsFont) 

Immediately after installing the text. This function will apply the font to the text in the field.

+1
source

All Articles