font questions again

32 views
Skip to first unread message

glantucan con golo lojo

unread,
Aug 22, 2013, 3:59:03 PM8/22/13
to haxe...@googlegroups.com
I'm having a hard time with fonts.

I had all the fonts embeded in from my openfl project application.xml file. The problem is that the compiled swf is too big and ned to make the initial download as light as possible.

So I put those fonts in a swf library and exported for flash 9 (as3) and used this tag in the application.xml (as found somewhere):
<library path="assets/fonts.swf" />

The generated final swf is half the original size (I guess Flash PRO compress the fonts) which is good enough for me.
But now I don't know how to get the embeded fonts. How would you do that? Nothing I found out there seems to work

Second, Is there a way to load fonts with mloader, for example, either directly or from a swf. How?

Regards
Óscar

Philippe Elsass

unread,
Aug 22, 2013, 4:41:15 PM8/22/13
to haxe...@googlegroups.com
If you target Flash Player, you may want to use Flash Pro or Flex SDK to create a font library SWF.

Here's an example of the code embedding a font and making it available to the application:

You can then load the SWF, wait a frame, and use the font as indicated in the 'fontFamily' attribute.

PS: of course this won't work for other OpenFL targets (HTML5, mobile,...).


--
To post to this group haxe...@googlegroups.com
http://groups.google.com/group/haxelang?hl=en
---
You received this message because you are subscribed to the Google Groups "Haxe" group.
For more options, visit https://groups.google.com/groups/opt_out.



--
Philippe
Reply all
Reply to author
Forward
0 new messages