[osflash] Problem embedding fonts with AS3
Arnoud Bos
a.bos9 at chello.nl
Tue Dec 11 13:44:27 PST 2007
Hi,
I think you can only embed true type fonts this way.
With otf fonts you should use flash and referencethe resulting swf.
Arnoud
_____
Van: osflash-bounces at osflash.org [mailto:osflash-bounces at osflash.org] Namens
Alexander Bienz
Verzonden: dinsdag 11 december 2007 19:06
Aan: osflash at osflash.org
Onderwerp: [osflash] Problem embedding fonts with AS3
Hi there,
When building my AS3 project using Flex SDK (2) I get the following
error...
rake aborted!
[ERROR] D:\workspace\flash\Dashboard
ComparisonChart\project\src\app\helpers\typography\Typography.as(10): col:
4: Error: Embed is only supported on classes and member variables.
[Embed(source="../../../../assets/fonts/LBIFedra-Regular.otf",
fontName="LBiFedra",
unicodeRange="U+0020-U+002F,U+0030-U+0039,U+003A-U+0040,U+0041-U+005A,U+005B
-U+0060,U+0061-U+007A,U+007B-U+007E")];
^
I've a file that holds information for all embedded fonts called
Typography.as
It has the following relevant lines of code...
public static const FEDRA : String = "Fedra";
[Embed(source="../../../../assets/fonts/Fedra-Regular.otf",
fontName="Fedra",
unicodeRange="U+0020-U+002F,U+0030-U+0039,U+003A-U+0040,U+0041-U+005A,U+005B
-U+0060,U+0061-U+007A,U+007B-U+007E")];
public static var Fedra : Class;
I'm calling the in a view that has a function for formatting and displaying
text...
private function createTitle() : void {
title = new TextField();
title.text = title_text;
title.antiAliasType = AntiAliasType.ADVANCED;
title.autoSize = TextFieldAutoSize.LEFT;
var tf : TextFormat = new TextFormat();
tf.size = 12;
tf.bold = true;
tf.font = Typography.FEDRA;
title.setTextFormat(tf);
addChild(title);
}
I've not managed to embed any fonts and I want them to be included at
compile-time.
Is there anything glaringly obvious that I'm doing wrongly here?
TIA
Alex.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://osflash.org/pipermail/osflash_osflash.org/attachments/20071211/c85d38ed/attachment.html
More information about the osflash
mailing list