Ah, thanks for the heads up Arnoud, In light of this, I converted my fonts to TrueType using FontForge, it works a treat.
Cheers, Alex. On Dec 11, 2007 9:44 PM, Arnoud Bos < [EMAIL PROTECTED]> wrote: > 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:* [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] *Namens > *Alexander Bienz > *Verzonden:* dinsdag 11 december 2007 19:06 > *Aan:* [email protected] > *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. > > _______________________________________________ > osflash mailing list > [email protected] > http://osflash.org/mailman/listinfo/osflash_osflash.org > >
_______________________________________________ osflash mailing list [email protected] http://osflash.org/mailman/listinfo/osflash_osflash.org
