# Loading and embedding fonts with code only. Doesn't work

**URL:** <https://forum.kirupa.com/t/loading-and-embedding-fonts-with-code-only-doesnt-work/264563>\
**Category:** Uncategorized\
**Created:** [June 27, 2008, 8:24am UTC](https://forum.kirupa.com/t/loading-and-embedding-fonts-with-code-only-doesnt-work/264563 "2008-06-27T08:24:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![joakimlinden](https://avatars.discourse-cdn.com/v4/letter/j/51bf81/32.png) [@joakimlinden](https://forum.kirupa.com/u/joakimlinden)\
**Post date:** [June 27, 2008, 8:24am UTC](https://forum.kirupa.com/t/loading-and-embedding-fonts-with-code-only-doesnt-work/264563/1 "2008-06-27T08:24:28Z")

</div>

I tried all day yesterday to find a solution to this… I’m generating some graphics which will be filled dynamically with text from an external xml. This text will be formatted with non-standard fonts, so I’ll have to embed the fonts.

I’ve found several blogs which talks about a method where you simply supply the path to the font and a name, which you then reference with a textformat object (format.font = “Name”).

I’m starting to doubt that this actually works in Flash CS3, and is only possible in Flex. Can anyone confirm this?

Example taken from one of the blogs:

```auto
[Embed(source='C:\WINDOWS\Fonts\FONT.ttf', fontName="Font", mimeType="application/x-font-truetype")]

mytextFormat.font = "Font";
// or
mytextField.htmlText = '<font face="Font">My text</font>';

```

A couple of blog links:  
[http://mx.coldstorageonline.com/?bid=48](http://mx.coldstorageonline.com/?bid=48)  
[http://www.marcosweskamp.com/blog/archives/000113.html](http://www.marcosweskamp.com/blog/archives/000113.html)
