schedal
June 27th, 2008, 05:39 PM
Hello yawl, well it seems that the confusion of embeding fonts in AS3 is still prevailent... I've managed to get embed fonts to work fine if I use TextFormat but if I use a StyleSheet it doesn't work... can anyone help me to get it to work with a StyleSheet? Once I can get this work in-line, I'll move the StyleSheet to an external file and load it in dynamically.
Here is the code I have that works:
var format:TextFormat = new TextFormat();
format.font = "Eurostile";
format.color = 0x000000;
format.size = 14;
format.letterSpacing = 4;
var label:TextField = new TextField();
label.embedFonts = true;
label.defaultTextFormat = format;
label.text = "Hello";
addChild(label);
This code however does not [and I copy-pasted the StyleSheet example from the help files]:
var style:StyleSheet = new StyleSheet();
var body:Object = new Object();
body.font = "Eurostile";
body.color = "#FF0000";
body.size = 14;
body.letterSpacing = 4;
style.setStyle("body", body);
var label:TextField = new TextField();
label.styleSheet = style;
label.embedFonts = true;
label.htmlText = "<body>Hello</body>";
//label.text = "Hello";
addChild(label);
With respectful gratitude,
:egg:
Sebastian.
Here is the code I have that works:
var format:TextFormat = new TextFormat();
format.font = "Eurostile";
format.color = 0x000000;
format.size = 14;
format.letterSpacing = 4;
var label:TextField = new TextField();
label.embedFonts = true;
label.defaultTextFormat = format;
label.text = "Hello";
addChild(label);
This code however does not [and I copy-pasted the StyleSheet example from the help files]:
var style:StyleSheet = new StyleSheet();
var body:Object = new Object();
body.font = "Eurostile";
body.color = "#FF0000";
body.size = 14;
body.letterSpacing = 4;
style.setStyle("body", body);
var label:TextField = new TextField();
label.styleSheet = style;
label.embedFonts = true;
label.htmlText = "<body>Hello</body>";
//label.text = "Hello";
addChild(label);
With respectful gratitude,
:egg:
Sebastian.