Copy link to clipboard
Copied
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)?
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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?
Copy link to clipboard
Copied
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)
Copy link to clipboard
Copied
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.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now