# Textfield align center and pixelfont

**URL:** <https://forum.kirupa.com/t/textfield-align-center-and-pixelfont/223919>\
**Category:** flash\
**Created:** [April 26, 2007, 7:17pm UTC](https://forum.kirupa.com/t/textfield-align-center-and-pixelfont/223919 "2007-04-26T19:17:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![nitech](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/nitech/32/2542_2.png) [@nitech](https://forum.kirupa.com/u/nitech)\
**Post date:** [April 26, 2007, 7:17pm UTC](https://forum.kirupa.com/t/textfield-align-center-and-pixelfont/223919/1 "2007-04-26T19:17:35Z")

</div>

Hey my fellow kirupians,

I have a little problem with a dynamic textfield. I create it, style it and fill it with text. The text is centered, and sometimes it ends up between two pixels and the text becomes blurry.

```auto
var font:TextFormat = new TextFormat;
font.font = "Fjords";
font.size = 8;
font.color = 0x000000;
font.align = "center";
label_txt.antiAliasType = "advanced";
label_txt.gridFitType = "pixel";
label_txt.selectable = false;
label_txt.setNewTextFormat(font);
label_txt.embedFonts = true;
label_txt.text = xmlModule.attributes.name.toUpperCase();

```

Unfortunately “pixel” does not work on center or right aligned text fields, so there my solution falls short.

How would you solve aligning a pixelfont centered?

Kind regards,  
nitech
