> Hi All
> 
> I have a loop that creates pages, creates textfields then 
> adds text. Some of this text has font tags and some doesn't. 
> I want to use a default textFormat so that an embedded font 
> is used when no <font is specified in the text:
> 
>             currentPage.createTextField("my_txt", 1, 5, 5, 
> currentPage._width - 10, currentPage._height - 10);
>             currentPage.my_txt.autoSize = false;
>             currentPage.my_txt.multiline = true;
>             currentPage.my_txt.wordWrap = true;
>             currentPage.my_txt.selectable = false;
>             currentPage.my_txt.embedFonts = true;
>             currentPage.my_txt.html = true;
> 
>             var my_fmt:TextFormat = new TextFormat();
>             my_fmt.font = "Arial";
>             currentPage.my_txt.setNewTextFormat (my_fmt);
> 
>             currentPage.my_txt.htmlText = this.Model.pages[i].text;
> 
> This works fine for text that has Arial specified in a font 
> tag but for all the other pages which are just text no text 
> appears (when tracing I see that Times is used which is not embedded).
> 
> Why isn't this working? The setNewTextformat should change 
> the default textformat for the field from then on? I am still 
> getting Times though.

setNewTextFormat is, in my opinion, broken: it works for text entered by a
user but not for text entered through ActionScript. You need to run
setTextFormat manually after changing it.

Danny

_______________________________________________
[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

Reply via email to