Hello! I am trying to use a font here, but when it is displayed I think the display result is not very smooth :eek:
Look what I am doing to create a text field:
[Embed(source="../Rrc/Fonts/Alleg.ttf",fontFamily="Alleg")]
private var allegFont:String;
private static var alleg:TextFormat = new TextFormat();
public function Depot()
{
alleg.size = 10;
alleg.font = "Alleg";
}
static public function createTextField(text:String):TextField
{
var result:TextField = new TextField();
updateTextField(result,"The quick brown fox jumped over the lazy dog.");
return result;
}
static public function updateTextField(result:TextField,text:String):void
{
result.embedFonts = true;
result.autoSize = TextFieldAutoSize.LEFT;
result.antiAliasType = AntiAliasType.ADVANCED;
result.defaultTextFormat = alleg;
result.selectable = false;
result.background = true;
result.text = text;
}
Yes, I instantiate somewhere the Depot class (depot = new Depot()).
Here is the result:
And this is how it should be:
I am using a ttf font, it can be found here: http://www.dafont.com/ernest-borgnine.font
Maybe I should disable anti-aliasing? I coundt find how
Thank you for help