I’m a very visual programmer. I like my applications to look decent before i start coding the underlying logic. In that same vein, i also like the font i’m developing with to look good.
While trolling the net today, i found this page: http://www.codeproject.com/KB/work/FontSurvey.aspx. Check it out. There are some very nice fonts there.
My two top fonts for development are:
Consolas and Monaco (the TextMate font – this is available for Windows too).
One of the things i love about Flash (and man, there are so few things) is that you can embed a range of Unicode characters of a specific font into your application. A range is basically a set of characters that exists in your desired font (ie Latin characters). For more info on Unicode characters and ranges, go here.
So, now, how does one embed a font into Flex?
Well, it’s actually quite simple. Inside of the <Style> tag or in an external .css file, you can embed a font using the following syntax:
@font-face
{
src:url("../assets/MyriadWebPro.ttf"); /* A .ttf inside your project */
fontFamily: myFontFamily;
}
or using an installed font:
@font-face
{
fontFamily: "Lucida Sans";
src: local("Lucida Sans");
}
The following syntax illustrates how to embed only certain unicode ranges of your font:
@font-face
{
src:url("../assets/MyriadWebPro.ttf");
fontFamily: myFontFamily;
unicodeRange:
U+0041-U+005A, /* Upper-Case [A..Z] */
U+0061-U+007A, /* Lower-Case a-z */
U+0030-U+0039, /* Numbers [0..9] */
U+002E-U+002E; /* Period [.] */
}
Now how cool is that?! Flex rocks!