14 August 2009

BUG : Include Device Font

While I was optimizing size of VGTrailers (I always try to be under 100K), I find something strange about device fonts, on Flash CS3 IDE.
Your best friend about size optimizing is size report (I suggest you to read this interesting post at Paul Burnett's madblog)

So, about the bug
If you create a dynamic textfield with a special font (I'll use Arno Pro) but with 'Use device fonts', you'll got something like this on the report size
Arno Pro 31
Switch to 'Bitmap text (no-alias)' and include the Latin character set
you have now
Arno Pro  12 pts 4539 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{}~
now switch to a static textfield THEN come back to 'Use device fonts'
Arno Pro 31
if you switch back to a dynamic textfield (still using 'Use device fonts'), you should still find 31bytes...but you have
Arno Pro 29683 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{}~
congratulation, you now have a font included for nothing...and 29k!
Why 29k ? switch to 'anti alias for animation' and you'll find the same size!
So, this bug includes an anti-aliased font while asking to include nothing but use system font.

I know you'll almost never make all these steps but I did, while trying the best font vs the best size, which ended to select a device font and so...

Note I was also able to include a '_sans' font if I switch to '_sans' while switching to dynamic field

No comments: