Hello,
I am having a problem with embedded fonts and I need some help. I've looked
around on the web and saw people with similar problems, however their
problem was that they never set TextField.embedFonts = true, which I am
doing.
I have a static class that creates a TextField on stage and formats it using
a TextFormat. This is the function that takes care of that:
private static function addTextField(theWidth:Number, tipText:String):Void {
// set the text format
theFormat = new TextFormat();
theFormat.color = options.textColor;
theFormat.font = "Arial";
theFormat.size = options.textSize;
theFormat.bold = options.isBold;
trace("the selected font should be "+theFormat.font);
// create the text field
_root.tooltipMC.createTextField("tooltipText", 3, options.textMargin,
options.textMargin, theWidth-options.textMargin, null);
_root.tooltipMC.tooltipText.selectable = false;
_root.tooltipMC.tooltipText.multiline = true;
_root.tooltipMC.tooltipText.wordWrap = true;
_root.tooltipMC.tooltipText.autoSize = true;
_root.tooltipMC.tooltipText.embedFonts = true;
_root.tooltipMC.setNewTextFormat(theFormat);
_root.tooltipMC.tooltipText.text = tipText;
trace("the actual font is:
"+_root.tooltipMC.tooltipText.getTextFormat().font);
trace("the actual new font is:
"+_root.tooltipMC.tooltipText.getNewTextFormat().font);
}
If I don't embed the fonts, the TextField uses Times New Roman. If I do,
then nothing appears in the TextField. I have tried using fonts embedded in
the library (properly linked) and standard fonts like Arial or _sans.
Nothing works. The traces always show "the selected font should be Arial"
(or whichever other font I choose) and "the actual font is: Times New
Roman"/"the actual new font is: Times New Roman".
I don't understand what the problem is. I am using very similar code in
another part of the movie and the fonts get embedded without any problems.
Could it have something to do with the fact that this is a static method in
a static class?
Thanks for the help,
--
Elie Zananiri
http://www.prisonerjohn.com
http://www.digital-spa.com
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com