# Setting and embedding a font to a textField

**URL:** <https://forum.kirupa.com/t/setting-and-embedding-a-font-to-a-textfield/261155>\
**Category:** flash\
**Created:** [May 23, 2008, 4:23pm UTC](https://forum.kirupa.com/t/setting-and-embedding-a-font-to-a-textfield/261155 "2008-05-23T16:23:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![blackcoma](https://avatars.discourse-cdn.com/v4/letter/b/48db29/32.png) [@blackcoma](https://forum.kirupa.com/u/blackcoma)\
**Post date:** [May 23, 2008, 4:23pm UTC](https://forum.kirupa.com/t/setting-and-embedding-a-font-to-a-textfield/261155/1 "2008-05-23T16:23:30Z")

</div>

Hi,  
I want to create a text field and write in it using a certain font from my font library.  
This is the code I use to create the textField:

```php
import flash.display.*;
import flash.text.TextField;

    var myText1:TextField = new TextField();
    myText1.text = "something";
    this.addChild(myText1);
    myText1.x = 110;
    myText1.y = 40;

```

I embedded the font in the library and gave it the linkage name: “font”

What code to I need to add in order to write this in this certain font?

Thanks

---

<div class="post-metadata">

**Author:** ![sasxa](https://avatars.discourse-cdn.com/v4/letter/s/da6949/32.png) [@sasxa](https://forum.kirupa.com/u/sasxa)\
**Post date:** [May 23, 2008, 6:11pm UTC](https://forum.kirupa.com/t/setting-and-embedding-a-font-to-a-textfield/261155/2 "2008-05-23T18:11:58Z")

</div>

you need to assign \*\*TextFormat \*\*object to _myText1.format_ property… check out documentation for more info…
