Sorry no fonts Displaying. I dont why it is comming .
I am using below process (code) please let me know where i did mistake below are the points.
- I have created new Air file with flash IDE and i have loaded fonts.swf
- after fonts loading completed then i have loaded page1.swf
- when i trace(Font.enumerateFonts()[k].fontName) // Arial, Kruti Dev 010
Fonts embed Process:
- fonts.swf Code
hindifont, arial in library
Doccument class code :
public class Main extends MovieClip
private var fonstsURL:String = "fonts.swf";
private var pagesURL:String = "page1.swf";
public function Main()
// constructor code
private function loadFonts()
var ldr:Loader=new Loader();
private function loadfile(e)
private function loadpages()
for (var k in Font.enumerateFonts())
var ldr:Loader=new Loader();
private function pagesLoaded(e)
//dynamic textfield in stage
When your textfield is on stage you can embed the font easily, select the textfield and go to that property and click the embed option there you can see select the character range.you select numerals option then it will display correctly.(This embed option you can get only in cs5,cs5.5 and cs6 not in cs4)
Thank's for your reply,
It is easy for me to embed all the fonts in one fla file, but the problem is I will have multiple fla's for multiple pages. it is be difficult to embed all the fonts in all the files and the size of the swf file will also be increased. I will change the text with different font through xml file at the run time. So, I am trying to load the swf file at the beginning where I have all the fonts embedded.
You should not need to use registerFont, at least I've not needed it. In order to use an embedded font, you should only need to make a Font object out of it, then use that in a TextFormat. Here's what I do:
var fontClass:Class = getDefinitionByName("libraryFontLinkageName") as Class;
var theFont:Font = new fontClass() as Font;
var texFormat:TextFormat = new TextFormat();
textFormat.font = theFont.fontName;
myField.defaultTextFormat = textFormat;
Mystring : <font face="arial" size="20"><b> this is audioTranscript M01L01T01ST01P07P </b></font>
You're bolding the font. This can often trigger havoc. You need to embed a font in regular, bold and italic (3 separate fonts and linkages) if you want to do things like that.
I suggest you set your linkage names to something other than a built-in font name. Arial is on every machine in existence. Setting embedFonts=true isn't enough to be clear to the machine which font to use. Use names that do not exist as system fonts like:
Then instead of using a <b> bold tag, do this:
<font face="ArialBold" size="20">this is audioTranscript M01L01T01ST01P07P</font>
A font is embedded as a Class so it should always start with an uppercase letter. That aside, are you using any fonts other than Arial? If not you really don't need to be going through all of this.
I'd swoop back and ask yourself, do you really want to embed a font that every computer and device already has? Try removing the embedded Arial font and don't set embedFont=true. Still set the TextFields AntiAliasType.ADVANCED however. Then just use the proper font name and it should use your computer or devices font directly which is much higher performance, especially on mobile devices. You can also use your bold tag again as you were.
<font face="Arial" size="20"><b>this is audioTranscript M01L01T01ST01P07P</b></font>
A TextFormat object will accept the device fonts name as a string too of course:
myTextField.defaultTextFormat = new TextFormat("Arial",20,0x0,true); // device font Arial, size 20, black, bolded
Simply make the font face a variable so you can change it to a font that's supported by other languages. If you're doing online training where the user needs to load your app over the Internet then this is typically a good practice.
I've had the unfortunate luck of having clients who both want a very specific non-standard font that needed Traditional and Simple Chinese. The font increased the initial download by 18MB. I'm not happy doing things like this, especially when the app is a promotional experience about a product. A user may sit through your download if it's an online e-learning course but not really for product advertising.
Try device fonts you know to contain the glyphs in the style you choose for any particular language first. Arial actually contains them all but it doesn't look like a "good font" to other cultures. I ended up doing this more and more and I typically do it with 13-15 languages. Only Asian and Cyrillic fonts are the bane of my existence. Luckily good old Arial will handle almost all your Latin.