[swfmill] Dynamic font sharing, some TTFs don't work
Tobias Hinz
th at skyco.de
Thu Oct 4 02:30:07 PDT 2007
Test reply. If this works then more to come ;)
SKYCO GmbH, Process and Workflow Management
Schliemannstr. 5 I 10437 Berlin
Tel. +49 30 55009711 I Fax +49 30 48494771
email: th at skyco.de http://www.skyco.de
-----Original Message-----
From: swfmill-bounces at osflash.org [mailto:swfmill-bounces at osflash.org] On
Behalf Of mawe
Sent: Mittwoch, 3. Oktober 2007 04:55
To: swfmill at osflash.org
Subject: [swfmill] Dynamic font sharing, some TTFs don't work
Hello there list,
in the last few days I've been in the search for dynamic font sharing
methods, and most involved the well-known ugly workaround by creating
two SWFs for one font and some crazy complicated export/import shared
asset stuff. I thought there must be an easier way and eventually
discovered that swfmill seems to be capable of just what I (and many
others) want. Oh, and first off, I'm using the latest available windows
build of swfmill (0.2.12.5).
See
http://www.deja-vue.net/blog/2006/05/26/as2-sharedfonts-datagrid-example-the
-last-stand/
for examples (might be still down, try
http://web.archive.org/web/20070621074407/http://www.deja-vue.net/blog/2006/
05/26/as2-sharedfonts-datagrid-example-the-last-stand/
instead).
OSFlash also points to this resource. Unfortunately, as the above site
is down, I can't grab the examples Mike provided. So I'm not sure how to
really integrate it. Anywaaaaaaaay, I somehow got it working now. The
problem is that it only works with some fonts, but not all. For example
it works with a font called "Dynamic BRK" (urbanfonts.com), but not with
any of the "Frutiger" styles.
The swfmill XML looks exactly the same as in the examples (except for
the font name attribute), my ActionScript goes here:
stop();
var assetContainer:MovieClip = _root.createEmptyMovieClip("container",
_root.getNextHighestDepth());
var assetLoader:MovieClipLoader = new MovieClipLoader();
var assetListener:Object = new Object();
assetListener.onLoadInit = function(mc)
{
trace(mc + " loaded");
setTimeout(_root, "bla", 1000);
//bla();
}
assetLoader.addListener(assetListener);
assetLoader.loadClip("frutiger.swf", assetContainer);
function bla(mc)
{
trace("bla called over");
var tfmt:TextFormat = new TextFormat();
tfmt.font = "dafont";
tfmt.size = 30;
tfmt.color = 0x333333;
var tf:TextField = _root.createTextField("test_txt",
_root.getNextHighestDepth(), 20, 20, 200, 200);
tf.border = true;
tf.embedFonts = true;
tf.antiAliasType = "advanced";
tf.text = "huhu";
tf.setTextFormat(tfmt);
}
The setTimeout call seems to be necessary to properly load the font SWF.
I already tried to set it to a longer wait time as the "Frutiger" font
swf is slightly larger than the "Dynamic BRK" on, but it does not help.
Thanks in advance for any input on this.
Regards
Matthias
_______________________________________________
swfmill mailing list
swfmill at osflash.org
http://osflash.org/mailman/listinfo/swfmill_osflash.org
More information about the swfmill
mailing list