swftools-common
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Swftools-common] Problem placing text with a consistent baseline


From: Sairam Suresh
Subject: [Swftools-common] Problem placing text with a consistent baseline
Date: Thu, 27 Sep 2007 06:18:38 -0700

It seems that opentype (.otf) and truetype (.ttf) fonts have different baselines, so when you insert them into an edittext object, you get different positioning.

for example, this works fine:

    .font helvetica " helvetica.otf"
    .text text_1 size=23pt font=helvetica color=#004400 text="abcdefg"
    .put text_1 x=67 y=10

    .font georgia "georgia.ttf"
    .text text_1 size=23pt font=georgia color=#004400 text="abcdefg"
    .put text_1 x=67 y=10

It produces two overlapping pieces of text in different fonts at the same position.

However this:

    .font helvetica "helvetica.otf"
    .edittext text_1 size=23pt font=helvetica color=#004400 text="abcdefg"   width=200 height=50
    .put text_1 x=67 y=10

    .font georgia "georgia.ttf"
    .edittext text_1 size=23pt font=georgia color=#004400 text="abcdefg"  width=200 height=50
    .put text_1 x=67 y=10

shows the two text objects offset vertically by some amount, and i can't consistently calculate what that is.

I get the same result when using actionscript and creating a textfield dynamically, so this isn't a bug in swfc, but I'd love to know if anyone here has a workaround or solution.

Any ideas?

reply via email to

[Prev in Thread] Current Thread [Next in Thread]