Hello,

I've been working with a marginally subclassed form of a TextField, which I need to display with embedded fonts. I'm noticing some surprising behaviour with the width property when embedded fonts are enabled, which is causing me trouble further on in my code.

Due to the way I am animating text, I am displaying each word in a separate TextField (or Word object, as I've subclassed it). I then reassemble a line of text with even spacing, and to that I need to know the width of each word, so that following words will begin at the correct x-position. Before I began to use embedded fonts, the width was reported accurately, as expected, but once I enable embedding, the width property is reported as a much lower value.

I've included the constructor for my Word object, which shows some traces for debugging, which I've given sample output for below.

PHP Code:
public function Word(wText:StringpartOfSpeech:StringchunkTag:String) {
    
text wText;
    
pos partOfSpeech;
    
cTag chunkTag;

    
setTextFormat(tFormat);
    
autoSize TextFieldAutoSize.CENTER;
    
deriveDuration();
    
trace("Pre-scale width: " width);
    
deriveScaling();
    
trace("Post-scale width: " width);
    
this.embedFonts true;
    
trace("Post-embed width: " width);

Example output from three separate words:
Code:
Pre-scale width: 22
Post-scale width: 45.45
Post-embed width: 8.450000000000001

Pre-scale width: 23
Post-scale width: 47.35
Post-embed width: 8.450000000000001

Pre-scale width: 50
Post-scale width: 71.8
Post-embed width: 5.800000000000001
One interesting thing is that for the first two Words listed above, the final width is the same, even though their originating widths vary - while for the third, it begins with a larger width than the first two, but ends up with a shorter one.

Sorry for such a long post, but I thought I should give some detail. I couldn't find any info on embedded fonts doing this using search engines, but maybe someone has heard of it happening before? Thanks a lot for any help.