I have done a tutorial about sharing fonts. Everything is working great except that some fonts won’t display… Does anyone know why ?
Here is the tutorial :
http://blog.sitedaniel.com/2008/10/f…-font-library/
Just replace the DynamicEvent by a simple Event.
And here is my main class:
package
{
import com.sitedaniel.text.FontControl;
import flash.display.Sprite;
import flash.events.Event;
import flash.text.TextField;
import flash.text.TextFieldAutoSize;
import flash.text.TextFormat;
/**
* ...
* @author
*/
public class Main extends Sprite
{
public function Main()
{
var fontControl:FontControl = new FontControl();
fontControl.addEventListener(FontControl.COMPLETE, _fontsLoaded);
fontControl.load("fonts/library.swf", [ { font:"Futura", id:"FuturaMdBT" }, {font:"Arial", id:"Arial"}, {font:"Tahoma", id:"Tahoma"}, {font:"Marlett", id:"Marlett"}]);
}
private function _fontsLoaded(pEvt:Event):void
{
var tf:TextField = new TextField();
var fmt:TextFormat = new TextFormat('Marlett', 30, 0x000000);
tf.autoSize = TextFieldAutoSize.LEFT;
tf.embedFonts = true;
tf.text = 'Lorem Ipsum...';
tf.setTextFormat(fmt);
this.addChild(tf);
}
}
}
Arial, Tahoma, Marlett worked great but Futura is not displayed…
I have done a few test, and there is more that won’t displayed. Any idea ?