[osflash] Fonts loading problems
darren at dcook.org
Wed Apr 26 18:45:33 EDT 2006
> styles. Obviously we don't want to load all the unused options, so we
> load he fonts and styles as individual .swf files. MOST of the time
> this works fine, but sometimes the font is displayed HUGE. ... Any
> other ideas how to fix this? If we add a delay after loading the font
> and style, that seems to correct the problem, ...
That is what we did on a recent project. We sleep for about 5 seconds at
the start of the program, hoping that the embedded fonts swf will be
fully loaded in that time. It is a long-running app so 5 seconds is only
a minor annoyance. (Our very large font swf seems to take about 2-3
seconds to load.)
To minimize the wait time, I did have an idea of trying to use the font
every 0.5s, on a hidden text field, and getting the width of the text.
If zero the font hasn't loaded, if non-zero it has.
I suspect this won't work as it seems as soon as we try to use an
embedded font that isn't loaded yet Flash will substitute a device font
for the lifetime of the swf. (I could be wrong on that though.)
One other idea is use swfmill (or similar) to put some small (non-font)
object at the end of the swf, after the font. We could then check to see
when that object exists.
I've not tried these ideas, but would be interested to hear the results
if you do,
More information about the osflash