# JSFL and useDeviceFonts

**URL:** <https://forum.kirupa.com/t/jsfl-and-usedevicefonts/303585>\
**Category:** flash\
**Created:** [January 22, 2010, 6:54pm UTC](https://forum.kirupa.com/t/jsfl-and-usedevicefonts/303585 "2010-01-22T18:54:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Captain\_Planet](https://avatars.discourse-cdn.com/v4/letter/c/85f322/32.png) [@Captain\_Planet](https://forum.kirupa.com/u/Captain_Planet)\
**Post date:** [January 22, 2010, 6:54pm UTC](https://forum.kirupa.com/t/jsfl-and-usedevicefonts/303585/1 "2010-01-22T18:54:43Z")

</div>

Hi all.

I’m trying to change all my fonts to ‘Arial’ and ‘Device Font’. Here is my code:

```auto
var dom = fl.getDocumentDOM();
var font_replace = "Arial" 
changeFonts = function(timeline) {
  for(var layer in timeline.layers){
    for(var frame in timeline.layers[layer].frames){
      for(var element in timeline.layers[layer].frames[frame].elements) {
        var item = timeline.layers[layer].frames[frame].elements[element];
        for(var txt in item.textRuns) {
          var font = item.textRuns[txt].textAttrs.face;
          if(font != font_replace)  
            item.textRuns[txt].textAttrs.face = font_replace;
   item.useDeviceFonts = true;
        }
      }
    }
  }
}
for(var i=0;i<dom.library.items.length;i++) {
    changeFonts(dom.library.items*.timeline)
}
changeFonts(dom.getTimeline());

```

It changes the font to Arial fine. However, it throws an error on the ‘item.useDeviceFonts = true;’ line stating:

Can’t set useDeviceFonts property of a horizontal text object.

I have no idea what this means. I noticed some other bod on these forums posted this issue a while back, but nobody responded. Thanks for any help.
