Are you making mxml file with FDT?

mx.core.FontAsset is part of the Flex Framework if I'm not wrong. You can't
use it for Flash, like you can't use Tile, HBox or other part of the Flex
framework.

For flash with FDT

- you can load a SWF containing the fonts

- add a SWC containing your fonts in the compiler
In the compiler arguments add:
-include-libraries C:\Fonts.swc

- use the metadata tag Embed (not work in flash IDE, only with Flex SDK):
http://www.scottgmorgan.com/blog/index.php/2007/06/18/runtime-font-embedding
-in-as3-there-is-no-need-to-embed-the-entire-fontset-anymore/

A useful method to check what's embedded

public function showEmbeddedFonts():void {
        trace("========Embedded Fonts========");
        var fonts:Array = Font.enumerateFonts();
        fonts.sortOn("fontName", Array.CASEINSENSITIVE);
        for (var i:int = 0; i < fonts.length; i++) {
                trace(fonts[i].fontName + ", " + fonts[i].fontStyle);
        }
}

Hope it helps.

Romu
www.soundstep.com


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of david
costard
Sent: 30 July 2008 10:41
To: [email protected]
Subject: [Flashcoders] Re: AS3 - Eclipse FDT - Problem with Embed Fonts

Hi,

I try whith a font from my file system and my problem is resolved but a new
one is present.
Now the error message is

Main_impact.as(10): col: 42 Error: La définition de la classe de base
FontAsset est introuvable.
public class Main_impact extends mx.core.FontAsset

Any ideas ?

Thanks.



2008/7/29 david costard <[EMAIL PROTECTED]>

> Hi List,
>
> I'm using Eclipse and FDT for an AS3 application.
> In this application I need to embed fonts.
>
> I search the correct technique in Joey Lott and in tutorial on the web.
>
> So in my class just before the constructor I write that :
> [Embed(source="assets/Arial Unicode MS.TTF", fontFamily="EaganFont",
> mimeType="application/x-font-truetype")]
> private var EAGAN : String;
>
> And when I try to generate the swf eclipse generate this error :
> ----------
> Loading configuration file
> D:\work\nurun\environement\eclipse\flex_sdk_3\frameworks\flex-config.xml
> Recompile: D:\work\nurun\environement\workspaces\test\fonts\src\Main.as
> Reason: The source file wasn't fully compiled.
> Files changed: 0 Files affected: 1
> D:\work\nurun\environement\workspaces\test\fonts\src\Main.as(14): Error:
> exception during transcoding: Unexpected exception encountered while
reading
> font file '/D:/work/environement/workspaces/test/fonts/src/assets/Arial
> Unicode MS.TTF'
>
>         [Embed(source="assets/Arial Unicode MS.TTF",
> fontFamily="EaganFont", mimeType="application/x-font-truetype")]
>
> D:\work\nurun\environement\workspaces\test\fonts\src\Main.as(14): col: 4:
> Error: unable to build font 'EaganFont'
>
>         [Embed(source="assets/Arial Unicode MS.TTF",
> fontFamily="EaganFont", mimeType="application/x-font-truetype")]
>    ^
>
> D:\work\nurun\environement\workspaces\test\fonts\src\Main.as(14): col: 4:
> Error: Unable to transcode assets/Arial Unicode MS.TTF.
>
>
>    ^
>
> (fcsh)
> ----------
>
> I've got the same errors if my var is a Class
> private var EAGAN : Class;
>
>
> Anyone had the solution of my problem ?
>
>
> Thank you.
>
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to