Creating Flex Component View using Flash CS5 – FONT Conflicts
We created some Flex based component views using Flash CS5 by following the instructions in the Adobe Article Combining animation and ActionScript using Flash Professional CS5 and Flash Builder 4 which we used inside our course player. These View components had text fields which would dynamically resize when the player was resized on the fly(Only for firefox and safari, IE and chrome do not allow resizing). These views also had images which would scale appropriately as well.
I initially just embedded the fonts like I did in Part 1 and Part 2 but ran into font conflicts. When I created a Flex component using Flash CS5 (which was placed in a swc library for use in Flex), I was getting font warnings along the line of :
Warning incompatible embedded font “Arial specified for spark components::Label (Label27) requires embedded font be declared with embedAsCff=true”
Based on the information in the following blog on Flex 4 SDK – the Halo namespace and embedded fonts , it appears the
classic text fields I used in flash CS5 had non-CFF based embedding fonts. The Flex spark components in the player used CFF embedded font formats. The generated swc library from Flash CS5 caused a conflict which was discussed in detail in Fix Disappearing Fonts Caused by SWC’s. One embedded font version would override the other ( would either have a CFF embedded font or a non-CFF embedded font with a specific font name).
This conflict required that I rename the fonts in the Flash CS5 generated swc for use within the Flex based player. The process involved required that:
- embed the font in a class with a different name for Flash CS5 component
- use that font class in the document class of the Flash CS5 view
Next in series Part 4