CounterMarch Systems

twitter ate my post


We used to blog more before twitter came along.

Fun with Flex, Modules and Embedded Fonts

Short version: I had the same problem this guy had. A nice, functional Flex 2 app, recompiled under Flex 3 suddenly lost the labels under the columns in a ColumnChart. Our resolution was no solution at all.

Apparently a ColumnChart in a Module is unable to use/find/render embedded fonts (wouldn't it be great if this triggered an exception? we thought so.). We tried dropping a hidden ColumnChart in the root module which didn't work (though had been a handy resolution to other singleton vs. module issues in the past) on the off chance it would somehow capture the proper font settings.

Rather than continue to fight, we realized that Arial was good enough for chart labeling so the simple resolution was to just set the fontFamily on the ColumnChart and leave the rest of the app to render in Gill Sans. Happily enough the app looks good, the client is no longer upset about the lack of chart labels, and we didn't have to spend a day digging through the Flex framework to resolve the issue.

So...if you run in to this...take my advice and drop down to a common font like Arial for your chart labels. It'll be interesting to test this more thoroughly under Flex 4 with all of the improvements you get with the text layout framework. For now, though, Flex 3.x + embedded fonts + charts in modules is a combination best worked around.

Comments
Scott's Gravatar This could be an issue with Gill Sans. I've been running into strange embed issues when using that font that don't occur with other fonts (even with other fonts in the Gill Sans family). I'm embedding GillSans (regular) and using it in custom styles, but it only shows up if I set the fontWeight attribute to bold (even though I'm not embedding the bold font!). I've tried embedding the font in Flex from a .swf file, too, with the same results.
# Posted By Scott | 2/2/10 6:04 PM

About the blog

Celebrating our 5th year!

CounterMarch Systems is a professional consulting firm specializing in Adobe technologies with a special focus on higher education.

2771 Red Oak Circle
Bethlehem, Pennsylvania 18017
610.280.3455
Contact Us