# Embeding font issue (beginner)

**URL:** https://forum.kirupa.com/t/embeding-font-issue-beginner/298698
**Category:** flash
**Created:** [October 23, 2009, 9:12am UTC](https://forum.kirupa.com/t/embeding-font-issue-beginner/298698 "2009-10-23T09:12:29Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![dalseide](https://avatars.discourse-cdn.com/v4/letter/d/bb73d2/32.png) [@dalseide](https://forum.kirupa.com/u/dalseide)
#### Post date: [October 23, 2009, 9:12am UTC](https://forum.kirupa.com/t/embeding-font-issue-beginner/298698/1 "2009-10-23T09:12:29Z")

</div>

Hi,  
I’m having a problem with embedding of fonts. Tried several ways to do this; with the library, and with the [embed]-code.

This is my actionscript now:

```auto

//rssReader.as
package classes.RSS {
	
	import flash.display.*;
  	import flash.events.*;
  	import flash.net.*;
  	import flash.utils.*;
	import flash.text.*;
	import Main;
	
	public class rssReader extends Sprite {
		
		
		[Embed(source='/classes/fonts/Chalkboard.ttf', fontName="Chalkboard", mimeType="application/x-font-truetype")]

		public function rssReader(_xmlURL) { 
			var xmlLoader:URLLoader = new URLLoader(); 
			var xmlData:XML = new XML(); 
			xmlLoader.addEventListener(Event.COMPLETE, LoadXML); 
			xmlLoader.load(new URLRequest(_xmlURL)); 
			  
			function LoadXML(e:Event):void { 
				xmlData = new XML(e.target.data); 
				textBox(xmlData);
			}
			

			function textBox(rssInput:XML) { 
				var formatTittel:TextFormat = new TextFormat();
				formatTittel.font = "Chalkboard";
				formatTittel.color = 0xFF0000;
				formatTittel.size = 13;
				
				
				var Tittel:TextField = new TextField();
				Tittel.embedFonts = true;
				Tittel.text = "Test Arial";
				Tittel.defaultTextFormat	= formatTittel;
				Tittel.width = 130;
				Tittel.height = 205;
				Tittel.x = 10;
				Tittel.y = 85;
				addChild(Tittel);

```

With this code, the text isn’t shown.  
If I remove the “Tittel.embedFonts = true;” statement the text is shown, but in the wrong font.  
The file chalboard.ttf is placed in one of the subfolders (the root folder is where Main.as and the .fla-file is).

Does anyone know why it wont work?
