How can you embed a font in as3 using FlashDevelop? I have read a lot of posts regarding this issue but none of them helped me solving it. When I use the following code, nothing is displayed (this is all the code) :
package
{
import flash.display.Sprite;
import flash.text.TextField;
import flash.text.TextFormat;
public class Main extends Sprite
{
[Embed(source="/../resources/fonts/andbasr.ttf", fontName = "andbasr", fontWeight = "Demibold", mimeType="application/x-font")]
private var andbasr:Class;
public function Main()
{
var textField:TextField = new TextField();
textField.embedFonts = true;
var format:TextFormat = new TextFormat("andbasr", 16, 0x000000);
textField.defaultTextFormat = format;
textField.text = "Test";
stage.addChild(textField);
}
}
}
"andbasr" is just a random ttf file I found. Any idea of what I am doing wrong?