I don't see why you still would want to add the fonts to the library of index.swf. The link I sent you is clearly about making a separate font class.
This is more or less what worked for me:
Make a new .fla file (e.g. myarial.fla). Give the file a document class like MyArial.as. In this document class, put:
package
{
import flash.display.Sprite;
import flash.text.Font;
public class MyArial extends Sprite
{
[Embed(source = "arial.ttf", fontFamily = "MyArial", mimeType = "application/x-font-truetype")]
public static var _myArial:Class;
public function MyArial()
{
super();
Font.registerFont(_myArial:Class);
}
}
}
In this I example I've got the .fla file, .as file and the font (.ttf file) residing on the same location. You could also point to your fonts folder of your system, like: source="C:/WINDOWS/Fonts/arial.ttf"
Publish your .fla. You might get the warning that you have to install the Flex SDK to get this embedding to work. I belief I had to do this, don't remember why. Should be more about in the article.
Put your new font .swf (e.g. myarial.swf) in the deploy folder, and make it an asset of index.
Now, from anywhere in your project you should be able to use "MyArial" as you typeface.
Like:
var myTextFormat:TextFormat = new TextFormat;
myTextFormat.font = "MyArial";
myTextFormat.size = 24;
myTextFormat.color = 0x000000;
var myText:TextField = new TextField;
myText.embedFonts = true;
myText.text = "Just some text".
myText.rotation = 15; //this is to check if the font is actually embedded. If the text rotates, it is.
addChild(myText);