Skip to main content
Pouradam
Inspiring
November 13, 2013
Answered

TLF Text - Negative leading values in TextFormat

  • November 13, 2013
  • 1 reply
  • 587 views

TLF seems not supporting negative values for "leading" (like Classic text) ?!

This code :

var tf : TextFormat = new TextFormat();

            tf.leading = -50;

            myText.setTextFormat(tf);

works fine in "Classic Text" but not TLF.

in Both cases (Classic, TLF) the result os TRACE is the same:

trace (myText.getTextFormat().leading);  // -50

But actually MINUS VALUES have no effect, and it is exactly the same as when leading is 0.

Any solution for this please?

Thanks a lot.

(Actual design when I apply different leading amounts based on a Function to the part BELOW horizontal line)

By the way, I also checked the same with "Arial" & "Tahoma", so it is not a unicode (Asian Fonts) issue.

This topic has been closed for replies.
Correct answer Pouradam

After lots of playing with code, I could solve it with a funny code!!

When I set leading to any number, it fails to show the CORRECT LINE SPACING :

tf.leading = -50;  // or ZERO or ANY OTHER NUMBER!


When I simply DO NOT SET leading (!!!) or set it to "null" (as it is by default), then line spacing becomes as it should be!!

tf.leading = null;

Hope it could hlep others


1 reply

Pouradam
PouradamAuthorCorrect answer
Inspiring
November 13, 2013

After lots of playing with code, I could solve it with a funny code!!

When I set leading to any number, it fails to show the CORRECT LINE SPACING :

tf.leading = -50;  // or ZERO or ANY OTHER NUMBER!


When I simply DO NOT SET leading (!!!) or set it to "null" (as it is by default), then line spacing becomes as it should be!!

tf.leading = null;

Hope it could hlep others