# AS3 Difficulty Embedding Font - please help

**URL:** https://forum.kirupa.com/t/as3-difficulty-embedding-font-please-help/208197
**Category:** flash
**Created:** [November 26, 2006, 6:08am UTC](https://forum.kirupa.com/t/as3-difficulty-embedding-font-please-help/208197 "2006-11-26T06:08:43Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Fingers](https://avatars.discourse-cdn.com/v4/letter/f/dc4da7/32.png) [@Fingers](https://forum.kirupa.com/u/Fingers)
#### Post date: [November 26, 2006, 6:08am UTC](https://forum.kirupa.com/t/as3-difficulty-embedding-font-please-help/208197/1 "2006-11-26T06:08:43Z")

</div>

I’m learning AS3 with Flex Builder 2, and have run into all sorts of difficulties when trying to embed a font so that a group of textfields will display correctly when they are tweened. There are a number of examples posted across the web which apparently work fine for other people, but I’ve tried them unsuccessfully. Perhaps this is because other people are using the Flash 9 alpha and it works differently in Flex, though I don’t know why that should be.

For example, with this code I receive an error that says "Unable to resolve “C:WindowsFontsARIAL.TTF for transcoding” even though the file exists in that location.

```auto

package {
    
import flash.utils.describeType;
import flash.display.MovieClip;
import flash.text.TextField;
import flash.text.TextFormat;
import flash.text.AntiAliasType;
  
   public class Test extends MovieClip {
    
      // be sure this is pointing to a ttf font in your hardrive
      [Embed(source="C:\WINDOWS\Fonts\ARIAL.ttf", fontFamily="foo")]
      public var bar:String;
                  
      public function Test() {
                    
         var format:TextFormat = new TextFormat();
          format.font = "foo";
          format.color = 0xFFFFFF;
          format.size = 130;
                        
          var label:TextField = new TextField();
          label.embedFonts = true;
          label.autoSize = TextFieldAutoSize.LEFT;
          label.antiAliasType = AntiAliasType.ADVANCED;
          label.defaultTextFormat = format;
          label.text = "Hello World!";
          addChild(label);
       }
    }
}

```

Could someone please post a working example?

Fingers
