views:

177

answers:

1

Hey

I'm usually creating 1 .as file per font and exports these .as files to swf's that I load in to my flash projects. This way I can choose what characters to embed.

Now I tested copying my verdana ttf fontfiles from my Windows font folder and embedded this to create a Verdana swf fontfile.

When I tested running this I tried with some swedish characters with dots (åäö ÅÄÖ). The dots above the characters from some of these charcters was positioned slightly offset (like a few pixels to the right or left). Anyone had the same problem?

Example code:

[Embed(source = 'fontfiles/verdana.ttf', fontName = 'Verdana', mimeType="application/x-font-truetype", unicodeRange = 'U+00-U+FF')]  
public static var font:Class;  

public function Verdana()
{
    Font.registerFont(font);
    var tf:TextField = new TextField();
    tf.embedFonts = true;
    tf.autoSize = TextFieldAutoSize.LEFT;
    tf.defaultTextFormat = new TextFormat("Verdana", 30);
    tf.text = "abc åäö ÅÄÖ";
    addChild(tf);
}
A: 

Changed:

[Embed(source = 'fontfiles/verdana.ttf', fontName = 'Verdana', mimeType="application/x-font-truetype", unicodeRange = 'U+00-U+FF')]  
public static var font:Class;

To:

[Embed(systemFont = 'Verdana', fontName = 'Verdana', mimeType="application/x-font-truetype", unicodeRange = 'U+00-U+FF')]  
public static var font:Class;

Seems like this did make it work.

Andreas Bergqvist