# \[AS2\] Problem: Generating Text with embedded font

**URL:** <https://forum.kirupa.com/t/as2-problem-generating-text-with-embedded-font/236583>\
**Category:** flash\
**Created:** [August 22, 2007, 12:42am UTC](https://forum.kirupa.com/t/as2-problem-generating-text-with-embedded-font/236583 "2007-08-22T00:42:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![RyanElston](https://avatars.discourse-cdn.com/v4/letter/r/e0b2c6/32.png) [@RyanElston](https://forum.kirupa.com/u/RyanElston)\
**Post date:** [August 22, 2007, 12:42am UTC](https://forum.kirupa.com/t/as2-problem-generating-text-with-embedded-font/236583/1 "2007-08-22T00:42:14Z")

</div>

I am trying to code a text ticker that can animate in many directions. I am have trouble doing the following:

1. Having text that generates correctly, using “font symbols” in the library defined in the textFormat object.

2. Having said text display when a mask was applied to it. (Text is not displaying)

My textFormat object is the following:

```auto
_txtFormat = new TextFormat ();
_txtFormat.font = "kroeger05_56_bold";
_txtFormat.color = 0x000000;
_txtFormat.size = 8;

```

And my generator is this method:

```auto
private function txtFieldGenerator (depth:Number, line:String):MovieClip
{
        var mc = _content.createEmptyMovieClip ("txtMC_" + depth, depth);
        var field_txt = mc.createTextField ("txt", 0, 0, 0, 0, 0);
        field_txt.text = line;
        field_txt.embedFonts = true;
        field_txt.setTextFormat (_txtFormat);
        field_txt.autoSize = "left";
        
        trace(mc._y)
        return mc;
}

```

What I’m getting is a text field that does not have the right font (the  
default font). And when I turn on masking in the class it wont show up  
at all. Does anyone have any insight? Thanks in advance.
