# Embedding fonts at runtime

**URL:** <https://forum.kirupa.com/t/embedding-fonts-at-runtime/263864>\
**Category:** flash\
**Created:** [June 19, 2008, 8:57pm UTC](https://forum.kirupa.com/t/embedding-fonts-at-runtime/263864 "2008-06-19T20:57:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![vsiege](https://avatars.discourse-cdn.com/v4/letter/v/db5fbb/32.png) [@vsiege](https://forum.kirupa.com/u/vsiege)\
**Post date:** [June 19, 2008, 8:57pm UTC](https://forum.kirupa.com/t/embedding-fonts-at-runtime/263864/1 "2008-06-19T20:57:09Z")

</div>

Can’t figure out how to use the code I have to load two or more fonts, and how to use them in a swf when loaded.  
I know how top embed a font and share it with another swf but…

1. how do you use it in the swf that loads it?
2. can you show me using two or more fonts?  
heres what i have so far to load 1 font:

```auto
var fontLoader:Loader = new Loader();
var fontLoaderInfo:LoaderInfo = fontLoader.contentLoaderInfo;
fontLoaderInfo.addEventListener(Event.COMPLETE, onFontLoaded);
fontLoader.load(new URLRequest("fonts/ArialRegular.swf"));
fontLoaderInfo.addEventListener(Event.COMPLETE, onFontLoaded);
function onFontLoaded (e:Event):void {
        trace("finished loading");
}

```

---

<div class="post-metadata">

**Author:** ![Felixz](https://avatars.discourse-cdn.com/v4/letter/f/ecb155/32.png) [@Felixz](https://forum.kirupa.com/u/Felixz)\
**Post date:** [June 20, 2008, 12:28pm UTC](https://forum.kirupa.com/t/embedding-fonts-at-runtime/263864/2 "2008-06-20T12:28:39Z")

</div>

```auto
function onFontLoaded (event:Event):void {
        Font.registerFont(Class(getDefinitionByName(nameOfFont)));
        trace("finished loading");
}

```
