I've always had good results like this:
In your application.css file (or in a <mx:Style> block), add these kinds of
font statements:
@font-face {
src: url("fonts/MyriadWebPro.ttf") ;
fontFamily: Myriad;
unicodeRange:
U+0021-U+007E; /* Normal Chars */
}
@font-face {
src: url("fonts/MyriadWebPro-Bold.ttf") ;
fontFamily: Myriad;
fontWeight: bold;
unicodeRange:
U+0021-U+007E; /* Normal Chars */
}
@font-face {
src: url("fonts/MyriadWebPro-Italic.ttf") ;
fontFamily: Myriad;
fontStyle: italic;
unicodeRange:
U+0021-U+007E; /* Normal Chars */
}
@font-face {
src: url("fonts/Myriad-BoldItalic.ttf") ;
fontFamily: Myriad;
fontWeight: bold;
fontStyle: italic;
unicodeRange:
U+0021-U+007E; /* Normal Chars */
}
You can change the unicodeRange to include whichever characters you need in
your application (see HYPERLINK
"http://www.w3.org/TR/1998/REC-CSS2-19980512/fonts.html#descdef-unicode-rang
e"www.w3.org/TR/1998/REC-CSS2-19980512/fonts.html#descdef-unicode-range).
Remember, if you don't need all the characters, then only include the one's
you actually need. This will make the swf file smaller.
Then, you can use these fonts in styles for different components. Like:
DateChooser {
fontFamily: Myriad; /* here's the font you declared in
the @font-face statements */
fontSize: 12;
fontWeight: normal; /* this is now MyriadWebPro */
headerColors: #84affe, #ffffff;
fillColors: #0057fe, #ffffff, #209820, #ffffff;
todayColor: #0057fe;
rollOverColor: #84affe;
selectionColor: #6cbb6c;
borderColor: #666666;
backgroundColor: #ffffff;
themeColor: #209820;
dropShadowEnabled: true;
shadowDirection: right;
shadowDistance: 1;
headerStyleName: "mydateChooserHeaderStyle";
weekDayStyleName: "mydateChooserWeekDayStyle";
}
.mydateChooserHeaderStyle {
fontWeight: bold; /* this becomes MyriadWebPro-Bold */
fontStyle: normal;
textDecoration: none;
}
.mydateChooserWeekDayStyle {
color: #0b333c;
}
You get the general idea. I use this all the time, and I've never had any
trouble with blurry fonts.
Hope this helps,
Randy
_____
From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Ary
Sent: Friday, September 21, 2007 4:42 AM
To: [email protected]
Subject: [flexcoders] pixel font [old] issue
Hi Guys,
i already try everything that i could found on the
internet to make it work, attaching direct
truetypefont(-blurry), make an swf file first from
flash and embed it on css(always get font 'fontname'
with normal weight and regular style not found).
could anyone pointing me into some direction please?
:|
and if possible with working example, when user dont
have that certain bitmap font on their system
thanks in advance
ary
____________-_________-_________-_________-_________-_________-_
Fussy? Opinionated? Impossible to please? Perfect. Join Yahoo!'s user panel
and lay it on us. HYPERLINK
"http://surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=7"http://surveyli
nk.-yahoo.com/-gmrs/yahoo_-panel_invite.-asp?a=7
No virus found in this outgoing message.
Checked by AVG.
Version: 7.5.488 / Virus Database: 269.13.28/1021 - Release Date: 9/21/2007
2:02 PM