# Html-formatting of dynamic text field with embedded font

**URL:** https://forum.kirupa.com/t/html-formatting-of-dynamic-text-field-with-embedded-font/201205
**Category:** Uncategorized
**Created:** [September 19, 2006, 1:26pm UTC](https://forum.kirupa.com/t/html-formatting-of-dynamic-text-field-with-embedded-font/201205 "2006-09-19T13:26:00Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Grudge](https://avatars.discourse-cdn.com/v4/letter/g/34f0e0/32.png) [@Grudge](https://forum.kirupa.com/u/Grudge)
#### Post date: [September 19, 2006, 1:26pm UTC](https://forum.kirupa.com/t/html-formatting-of-dynamic-text-field-with-embedded-font/201205/1 "2006-09-19T13:26:00Z")

</div>

If you’re creating a htmlText field via the createTextField method, is there a way to get html formatting like \<b\>\</b\> to show up if you are also embedding a font?

I’m guessing not, since you can only embed a single font in a TextFormat, and you would have to embed both italic and bold variants too to make it work. Is this true?

Maybe I’m better off creating a generic text field on the stage with both bold and italics embedded, and use the attachMovie method instead?

This is my code:

```
ActionScript Code:
[FONT=Courier New][LEFT]myformat = [COLOR=#000000] **new** [/COLOR] [COLOR=#0000FF]TextFormat[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR];
    myformat.[COLOR=#0000FF]font[/COLOR] = [COLOR=#FF0000]"Akzidenz_Grotesk_BE_Light"[/COLOR];
    myformat.[COLOR=#0000FF]size[/COLOR] = [COLOR=#000080]20[/COLOR];
    
    curr_image = curr_top.[COLOR=#0000FF]createTextField[/COLOR][COLOR=#000000]([/COLOR][COLOR=#FF0000]"largetext"[/COLOR], [COLOR=#000080]401[/COLOR], [COLOR=#000080]242[/COLOR], [COLOR=#000080]32[/COLOR], [COLOR=#000080]682[/COLOR], [COLOR=#000080]254[/COLOR][COLOR=#000000])[/COLOR];
     curr_image.[COLOR=#0000FF]selectable[/COLOR] = [COLOR=#000000] **true** [/COLOR];
    curr_image.[COLOR=#0000FF]multiline[/COLOR] = [COLOR=#000000] **true** [/COLOR];
    curr_image.[COLOR=#0000FF]html[/COLOR] = [COLOR=#000000] **true** [/COLOR];
    curr_image.[COLOR=#0000FF]embedFonts[/COLOR] = [COLOR=#000000] **true** [/COLOR];
    curr_image.[COLOR=#0000FF]htmlText[/COLOR] = [COLOR=#FF0000]"Hello &lt;i&gt;this&lt;/i&gt; is a &lt;b&gt;text&lt;/b&gt; field"[/COLOR];
    curr_image.[COLOR=#0000FF]setTextFormat[/COLOR][COLOR=#000000]([/COLOR]myformat[COLOR=#000000])[/COLOR];

```

[/LEFT]  
[/FONT]
