How to use the Extra-Bold like weights of Embedded Fonts?
Hello All,
So I embedded a font I just recently downloaded and the font came with a bunch of different weights/styles, each in their own .otf file, like these:
- Regular
- Light
- Bold
- Italic
- Bold-Italic
- Extra-Bold
- Extra-Bold-Italic
So what I did was I embedded the font into my library and also embedded each of the above styles of that font as well, and exported them for Actionscript. I am using each font I embed by implementing StyleSheet objects, like so:
var textStyle:StyleSheet = new StyleSheet(); textStyle.setStyle("myStyle1", {
textAlign: "left", fontFamily: "Name of Font" });
my_textField.embedFonts = true;
my_textField.styleSheet = textStyle;
my_textField.htmlText = "<myStyle1>Blah blah blah, some test text.....</myStyle1>";
And after reading about StyleSheets for AS3 here http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/StyleSheet.html I can see that font-style supports "normal" or "italic" and font-weight supports "normal" or "bold". So how can I use the styles of the font I embedded like "Extra Bold", "Extra Bold Italic", etc...
Any thoughts or suggestions would be much appreciated!
EDIT:
I also forgot to mention that I used the code below to print out all the available embedded font names using the trace command, and even though I embedded 5 or 6 different styles/versions of the same font, it only printed that font name once. I was thinking that maybe it used an entirely different font name but it didn't. And from what I had read recently to use the font I embedded you would use the name that prints out from the loop below, and not the name I created that was exported for Actionscript.... Is that right?
var fonts:Array = Font.enumerateFonts();
for (var i:int = 0; i < fonts.length; i++)
trace(fonts.fontName);
Thanks in Advance,
Matt
