View Full Version : fontFamily: "odd, sans-serif, issue"

02-13-2011, 10:04 AM
Hi.. I'm creating styles within actionscript. eg..

styleSheet.setStyle("p", {
fontFamily: "font1, font2, font3"

..and I'm getting unexpected results using 'sans-serif' (or '_sans') as a named font. Has anyone else come across this?..

fontFamily: "sans-serif"
(flash player uses _sans device font as expected)

fontFamily: "NonExistentFont, sans-serif"
(flash player uses _serif device font, hmm)


Other tests..

fontFamily: "sans-serif, NonExistentFont"
(flash player uses _serif device font)

fontFamily: "NonExistentFont, sans-serif, Verdana"
(flash player uses Verdana)

fontFamily: "sans-serif, Verdana"
(flash player uses Verdana)

Compiling with CS5, testing with v10.1 players.

var css:StyleSheet = new StyleSheet();
css.setStyle("p", {
fontFamily: "NonExistentFont, sans-serif"

var tf:TextField = new TextField();
tf.width = 150;
tf.x = tf.y = 10;
tf.styleSheet = css;
tf.htmlText = "<p>Am I sans-serif or what?</p>";


02-19-2011, 07:14 PM
..So far I haven't been able to find any other info about this issue. I've just repeated the same tests using the latest v10.2 players (on WinXP) and the results are the same.

Perhaps some of you guys who are NOT developing on WinXP / Flash CS5 / 10.x players could tell me what results you get with the code included above..? I'd appreciate it. Thanks.

05-05-2011, 11:44 AM
And the answer is...pending. Thought I had it but I don't.