actionscript 3 - Loading and unloading fonts for multilingual Flex app -
my flex app allows people enter text. there's broad selection of fonts choose from. because multi-lingual app, of fonts (e.g. chinese) large indeed - big embed fonts.
i know can load fonts @ runtime via stylesheets - plan people select font (a small wait while font loads not problem). want able unload fonts again, app doesn't consume huge amount of memory if people select 1 font , another.
i can't see way it, though. can load fonts @ runtime, not unload them. ideas?
i did see this question on mentions loading fonts part of module - 1 font per module, guess. advantage being modules can unloaded. then, font isn't accessible outside module, questioner points out. seems dead end.
if it's not possible, - sadly - accept answer shows me it's impossible, more useful alternative strategy! must pretty common scenario people have run before...
as intuition suggests, relatively common scenario flex developers - there's got solution!
as have suggested, compile stylesheets modules fonts embedded in each (for chinese, suggest @ specifying unicode ranges if possible save on font size: http://renaun.com/blog/2011/10/flash-embed-font-unicode-range-generator/).
there 3 application domains can load modules parent app. take @ this: http://help.adobe.com/en_us/actionscript/3.0_programmingas3/ws5b3ccc516d4fbf351e63e3d118a9b90204-7e07.html. believe 2 out of 3 ways allows use resources module. easiest load same application domain - meaning assume classes in module same parent's.
make sure build system compiling modules same version of sdk parent application. otherwise, run actionscript runtime errors marshalling classes.
finally, how profiling application garbage collection? using flash builder's built-in profiler? forcing garbage collection on flex app annoying (from remember, must call system.gc()
twice or weird voodoo magic that).
Comments
Post a Comment