Note that there are some explanatory texts on larger screens.

plurals
  1. POAligning textfields close together produces inaccurate spacing appearance
    primarykey
    data
    text
    <p>I've added Arial as an embedded font to my font format, which I've added to numerous textfields that must be aligned accurately next to each other to create the appearance of spaces. They are aligned approximately 1 - 2 pixels next to each other. The problem is that they look inaccurately spaced when viewed at the normal stage size, but when I zoom in the text looks fine. </p> <p>I've tried messing around and adding advanced antialiasing, but nothing is working. Perhaps Arial doesn't work at small sizes? I know not setting a font it produces the results I want, however it's not the font I want to use; it must be using Times?</p> <p>Any ideas?</p> <pre><code>var myFont = new Font1(); format1 = new TextFormat(); format1.color = 0x000000; format1.size = 16; format1.font = myFont.fontName; </code></pre> <p>EDIT: Essentially I'm splitting up each character into its own textfield, so I can manipulate each character and animate it. But to do so I need to space the characters as though it was one textfield.</p> <pre><code>private var bmd:BitmapData; // bitmapdata to draw textField in; private function getExactMetrics(textField:TextField):Object { // copy textField to bitmap bmd = new BitmapData(textField.width,textField.height,true,0x000000); bmd.draw(textField); // loop through pixels of bitmap data and store the x location of pixels found. var foundx:Array = []; for (var nx:int = 0; nx &lt; bmd.width;nx++) { for (var ny:int = 0; ny &lt; bmd.height; ny++) { var px:uint = bmd.getPixel32(nx, ny); if (px != 0) { foundx.push(nx); break; } } } // get the values for the metrics var startX:int = foundx[0]; // first pixel found representing the x start of the text in pixels var endX:int = foundx[foundx.length-1]; t var realWidth:Number = endX - startX; // clear the array with found x positions foundx = []; // wrap values in object var metrics:Object = { }; metrics.width = realWidth; metrics.x = startX; // clear bitmapdata bmd = null; return metrics; // retrurn metric object; } } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload