02-11-2012 10:51 PM
I`m trying to embed fonts for the first time into an AIR app.
This is what I tried:
[Embed(source="BRITANIC.TTF", fontFamily="BritanicEmbed", mimeType="application/x-font")]
public var BritanicEmbed:Class;
var textFormat:TextFormat = new TextFormat();
textFormat.font = "BritanicEmbed";
lblTitle = new Label();
lblTitle.format = textFormat;
lblTitle.text = "Test";
lblTitle.embedFonts = true;
... and that worked great.
But that was just a tester. The actual font I need to use is a .otf font. (OpenType Font) When I try:
[Embed(source="TrajanPro-Regular.otf", fontFamily="TrajanProEmbed", mimeType="application/x-font")]
public var TrajanProEmbed:Class;
... running mxmlc gives:
Error: exception during transcoding: Font for alias 'TrajanProEmbed' with plain weight and style was not found at: ...
Has anyone here gotten OTF fonts to embed. (Note: I`m using the command line and mxmlc to compile my AIR apps, if that makes any difference)
PS I also have a .ttc font (whatever that is) that I need to use. Is that possible.
Solved! Go to Solution.
02-11-2012 11:24 PM
Since posting this, I came across:
By converting the .otf and .ttc fonts I had to .ttf fonts, I was able to embed them.
The problem I`m having now is that the embedded fonts looks very bad. I`ve taken a screen capture and zoomed in, and while it does look like they are anti-aliased, they still look terrible.
I was worried that perhaps the tool at the onlinefontconverter was responsible, but if I open the converted fonts in Word, they look perfect at all sizes.
So now I don`t know what to do -- I have no idea why the fonts would look terrible. (For reference, I`m using a font size of 44)
02-11-2012 11:34 PM
Thank the Lord.