Friday, March 13, 2009

Flex embedding fonts within Buttons

I was using embedded (ttf) fonts within some Flex labels and they rendered fine; however, when I tried using the same font-family with Flex Buttons, they did not render at all. After some testing, I think I have it figured out,: if your embedded fonts don't render correctly, they may be using default flex font settings that are not supported within the ttf file. I had to make sure that my font-family was using 'fontWeight: normal' to make my own embedded font appear.

Here is an example, notice (in purple) what I added:



@font-face {
src: url("TravelingTypewriter.ttf");
fontFamily: TravelingTypewriter;
advancedAntiAliasing: true;
}

.myStyle {
embedFonts: true;
fontFamily: TravelingTypewriter;
textRolloverColor: red;
fontWeight: normal;
}




Tuesday, January 6, 2009

Comipling Flex components together with your application via command-line

Flex’s “mxmlc” compiler automatically searches sub-folders within your root package directory for source files, you don’t need to specify them on the command line. The reason mxmlc might complain that it does not know where some custom ActionScript classes are is because you may have forgotten to import the custom component files inside the class you use them in!