Hi Eric,

Thanks for that - but it doesn't seem to solve my problem. :-)

I can get getTextExtent() _working_ perfectly happily - I just can't
get it to work using the actual metrics of the embedded font, only
(apparently) of the system version of that font. (Or possibly what's
happening is it's using the metrics of the embedded font but isn't
taking antialiasing into account - or something like that.)

If I turn font embedding off then the field lays text out in exactly
the way that getTextExtent() predicts that it should - if I turn font
embedding on, then the text in the field is slightly wider than
getTextExtent thinks it should be.

What it looks like I need to do is to make getTextExtent() use the
embedded version of the font for it's calculations. And that's where
I'm stumped - I'm using getTextFormat() on the field which has the
font embedded in it, but it looks like that isn't getting through to
getTextExtent().

Cheers,
  Ian

On 3/20/06, Éric Thibault <[EMAIL PROTECTED]> wrote:
> Hi! Here is some code I've used... maybe could help... It was working!
>
> //The last time I used getTextExtent...
>
> var txt_fmt = new TextFormat();
> with(txt_fmt) {
>         font = "Arial";
>         size = 12;
>         bold = true;
>         color = "0xBEA875";
>     }
>
>     var metrics = txt_fmt.getTextExtent("here is my text...");
>
>
> this.createTextField("dynamicText",10,0,0,metrics.textFieldWidth,metrics.textFieldHeight);
>     dynamicText._visible = 0;
>     dynamicText.multiline = false;
>     dynamicText.wordWrap = false;
>     dynamicText.selectable = false;
>     dynamicText.text = MonTexte;
>     dynamicText.setTextFormat(txt_fmt);
>
> Éric.
>
>
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to