Use Fade without embedding fonts (in Moxie)

Every now and then, a bug fix comes along and you just want to jump for joy and say “hallelujah!”. Well, last week, one of those came in. The team has been pretty tight in selecting bugs to get fixed lately, but, I thought, it wouldn’t hurt to ask to have SDK-12901 fixed. This bug is one of many that complains that you cannot use a fade effect on any text unless the font for the text is embedded. This is one of the first things that Flex developers run into when they begin to use effects, like Fade. For a long time, we couldn’t fix this since there was a Flash Player limitation. However, a workaround has been provided to us by the player team in recent months. So, coming in Moxie … (drumroll, please) … you will be able to Fade text without embedding your fonts. This hasn’t been fully tested yet, so, some bugs may still be lingering, but, it has been checked in and I verified that it did work with a < mx:Label > and a Fade. Here was the checkin notice:

Change 188500 by jszeto@JSZETO-XP on 2007/11/20 20:20:51

Flex SDK Beta3 Bug Fix

SDK-12901 – Add support for system text in the Fade Effect

Applying a filter to a DisplayObject forces the Player to create a bitmap of that object. System font text can not be alpha’ed. But bitmaps can. So, in FadeInstance, I apply a BlurFilter (with values set to 0) to the target if the target doesn’t have any current filters. When the effect ends, we remove the temporary filter.

Bugs: SDK-12901
QA: Yes
Doc: Yes!!!!

4 responses

  1. Cool! This would make programming flex apps more intuitive to developers from different programming background.

    It’s simple change that solved developer-usability issue.


  2. this is not a good idea.
    the operating system anti-aliases the system fonts at bigger sizes, but if the flashplayer creates a bitmap of it, it won’t.
    go and try. create a textfield at the stage, with a font size 50px, and with some device font, publish. and after give a 0-0px blur filter to it, and re-test. the filtered version will be ugly and jagged.

  3. I guess the workaround involved creating a bitmap and applying the filter to the bitmap.

    This creates a new security error, if you guys haven’t noticed. When the image is being loaded from a different domain from your application, you cant do any bitmap manipulation on the image. Doing so will cause a security error in latest players. I had a real tough time because of this new change. The bitmap.draw call in MaskEffectInstance class was the one that was causing it.

    Am not sure if a people would like that happen now.. ( there are apps that load images from flickr, for example. now those apps will all have issues)

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: