Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How to add negative leading for a TextBox

New Here ,
Feb 14, 2019 Feb 14, 2019

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)?

TOPICS
Scripting
1.3K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 15, 2019 Feb 15, 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Feb 18, 2019 Feb 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?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 19, 2019 Feb 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)

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Feb 25, 2019 Feb 25, 2019
LATEST

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines