Skip to main content
Participant
February 14, 2019
Question

How to add negative leading for a TextBox

  • February 14, 2019
  • 3 replies
  • 1376 views

It seems that Leading for text cannot be negative.  The Character panel does not allow negative numbers for Leading and negative values set via script generate an exception.  Does anyone know of a way to decrease the space between lines of text in a TextBox (i.e. paragraph text)?

This topic has been closed for replies.

3 replies

d_greenAuthor
Participant
February 19, 2019

I had a value of 100 in the paragraph panel for space before a Paragraph and I was using the enter key to separate lines.  In this case,  the leading between lines of text cannot be less than the Paragraph setting for space before a paragraph - so, the lines of text (for a100 pixel font) would not overlap when the leading was set to 0.

Note that resetParagraphStyle() can be used to clear all values, but you cannot set a specific value (e.g. set space before a paragraph to 10)

Tomas Sinkunas
Legend
February 25, 2019

Well, text document values only reflect the first character in the text layer at the current time. Therefore you cannot change values in multiple places of same text layer.

Tomas Sinkunas
Legend
February 18, 2019

To change the leading property, all you need to do is this:

var textDocument = textLayer.property('ADBE Text Properties').property('ADBE Text Document');

var textValue = textDocument.value;

textValue.leading = 0; // New leading value

textDocument.setValue(textValue);

However, negative leading values are not supported. On the other hand, how would you expect negative values to work? Push lines upwards instead of downwards?

Theodoros Tziatzios
Participating Frequently
February 16, 2019

If I'm guessing right you are trying to set a negative Leading value on the character panel, to make your lines go upwards instead of downwards, correct?


Just add a "Line Spacing" animator on the text Layer and set the (second) value to whatever value you prefer, positive or negative.