PDA

View Full Version : Embedding fonts for dynamic text.


jonnyG07
08-12-2008, 08:44 AM
Hi,

I am having a problem embedding the fonts for text which i have created dynamically. I am creating the text format and text field in a class file, then using a create Text function. I pass the create Text function all the attributes related to the text. In the the create Text function i also define other attributes such as selectable.
I have tried using embedFonts = true; However this then causes none of the text to appear.

Does anyone know of a solution to this problem?

Thanks

pj-co
08-12-2008, 09:37 AM
what compiler are you using? flex or flash?

http://livedocs.adobe.com/flash/9.0/UsingFlash/help.html?content=WSd60f23110762d6b883b18f10cb1fe1 af6-7d33.html

QuantumTiger
08-12-2008, 09:58 AM
How are you naming the font in the text format? In the embed tag systemFont is the real name of the font and fontName is the name that you will refer to the font by in the code.
[Embed(mimeType='application/x-font',systemFont = 'trebuchet ms', fontName='myTrebuchet')]
var trebuchetFont:Class;

var fmt:TextFormat = new TextFormat;
fmt.font = "myTrebuchet";

var tf:TextField = new TextField();
tf.defaultTextFormat= fmt;
tf.embedFonts = true;