# Embedded font not visible

**URL:** <https://forum.kirupa.com/t/embedded-font-not-visible/293491>\
**Category:** Uncategorized\
**Created:** [July 29, 2009, 7:33pm UTC](https://forum.kirupa.com/t/embedded-font-not-visible/293491 "2009-07-29T19:33:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![BoppreH](https://avatars.discourse-cdn.com/v4/letter/b/dbc845/32.png) [@BoppreH](https://forum.kirupa.com/u/BoppreH)\
**Post date:** [July 29, 2009, 7:33pm UTC](https://forum.kirupa.com/t/embedded-font-not-visible/293491/1 "2009-07-29T19:33:29Z")

</div>

I stumble upon some problems with Flash IDE’s font embedding, so I gave it a try and went full AS3:

```auto
        function configureTextField(field:TextField, color:uint = 0x0099FF, size:int = 16) {
			field.scaleX = field.scaleY = 1
			field.defaultTextFormat = new TextFormat((new DefaultFont()).fontName, size, color, true, null, null, null, null, null, "center")
			field.embedFonts = true
			field.antiAliasType = AntiAliasType.ADVANCED
		}

[...]

        var fields:Array = [txtUser, txtPassword, txtName]
		for each (var field:TextField in fields) {
			configureTextField(field, 0x666666)
		}

```

“DefaultFont” being a library symbol of a proper font.

Problem is, this function only works in half the fields I pass to it, randomly. When it “fails”, the field seems empty (even when it’s not) and if it’s an input one it’s not possible to even place the text cursor in it.

No error, no warning and the fields are exact copies of the other with different instance names.

In the example above “txtPassword” worked but not “txtUser”.

What could it be?
