flash - What's the definition name for fonts loaded at runtime created with fontswf? -
i ran 'fontswf' utility embed ttf fonts swf , struggling load them @ runtime app. examples find online refer loading font via [embed] loading them flash.display.loader , gather, once loader.contentloaderinfo fires event.init need register font, so:
public function handleloadercomplete( event:event ):void { var fontclass:class = event.target.applicationdomain.getdefinition( fontname ); font.registerfont( fontclass ); } the problem don't know pass in fontname. generating swf through:
$ fontswf -a belshaw -o belshaw.swf belshaw.ttf but when try call getdefinition( 'belshaw' ), error saying 'variable belshaw not defined'. suggestions on how accomplish this?
the alternative generate on swf files through templating .as file , compiling them, rather use built in tool fontswf if it's there.
thanks
ruy
i on project had allow users dynamically upload own fonts. tried getting fontswf work , ran issue after issue , terrible documentation did nothing help. created template , use bash script embed .ttf file new .swf, service returns url .swf, main app loads .swf , registers font.
i know that's not answer question, know works. ;)
Comments
Post a Comment