Ls,
In short: I embed a font:
Code:
[Embed(source="tetsubin.ttf", embedAsCFF="false", fontFamily="MSMincho", fontName="MSMincho")]
private static const MSMincho:Class;
I register the font:
Code:
Font.registerFont(globals.interfaceMainFontClass);
I load an external .swf:
public function startLoad(in_SWF_name:String):void
Code:
{
trace("LOADING SPLASH SWF", in_SWF_name);
var mRequest:URLRequest = new URLRequest(in_SWF_name);
myloader.contentLoaderInfo.addEventListener(flash.events.Event.COMPLETE, completeHandler);
var _lc:LoaderContext = new LoaderContext(false, ApplicationDomain.currentDomain, null);
myloader.load(mRequest, _lc);
}
protected function completeHandler(event:flash.events.Event):void
{
scene1 = event.target.content as MovieClip;
myDEV = new DialogEntryViewer(this, scene1, globals.GuiDialogsXML, globals.GuiStorylineXML);
myDEV.addEventListener(flash.events.Event.ADDED_TO_STAGE, swfats)
Starling.current.nativeStage.addChild(myDEV);
myloader.removeEventListener(flash.events.Event.COMPLETE, completeHandler);
}
In it are some dynamic textfields. I wish to change the texts in them, that I got working.
But I also want them to use the Embedded font family for displaying Asian and Arab texts. That aint flying yet.
Code:
flashtextfield = myscene.getChildByName("santext" + (i+1==1? "" : String(i+1))) as flash.text.TextField;
var pc:DisplayObjectContainer = flashtextfield.parent;
flashtextfield.autoSize = TextFieldAutoSize.CENTER;
flashtextfield.y = pc.height * 0.5 - flashtextfield.textHeight * 0.5;
var fformat:TextFormat = new TextFormat("MSMincho");
fformat.font = "MSMincho"
fformat.color = 0xFFFFFF;
fformat.size = 18;
fformat.underline = true;
fformat.italic = true;
flashtextfield.embedFonts = true;
flashtextfield.setTextFormat(fformat);
What am I doing wrong?
Highest regards,
Mac