Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>If I am right in understanding, than you want to remove/unregister all fonts that are not that complete as the version of this specific font that was already loaded, but embedded in another swf?</p> <p>Every Font that is embedded creates a class, every swf you load via the Loader class is by default loaded in its own application domain, to prevent namespace clashes, but you can force the loader to load everything into the current application domain with the »loader context« parameter of the Loader's load() method. So this way you could try to force to override classes in the same namespace with each other, but than you cannot control which class to throw away, means you cannot check which font has more glyphs. (maybe it just throws errors instead of overriding and doesn't run at all, i am not that sure about this).</p> <p>On the other hand you should question how fonts are actually embedded in the child's swf-files. I know no other way than to embed fonts as: </p> <p>in *.fla-files as »library symbol«, or in code of flashbuilder or flex like this: <code>[Embed(source="c:/windows/fonts/verdana.ttf", fontFamily="Verdana", embedAsCFF="false")]</code>,</p> <p>or this:</p> <pre><code>@font-face { src: url("../assets/MyriadWebPro.ttf"); fontFamily: myFontFamily; advancedAntiAliasing: true; } </code></pre> <p>in mxml files. So the (that is what I guess) the resulting Name of the class that is generated depends on the »font-family« property (or even more settings) given by the developer, means even if the same font is embedded twice the class-name might differ caused through the settings.</p> <p>Also there is no <code>Font.unregisterFont()</code> method, so how to manage this stays a good question, just in case that you might find the same Font class somehow (perhaps RegExp becomes a friendly helper).</p> <p>I think to solve this properly you need control at compile time, using xml based *.xfl project files might help but even than the referenced Font-File can have a different Name.</p> <p>A nice problem, good luck</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload