[Bug report] lineSpacing

Issue

Text.lineSpacing returns 0 when using the default lineSpacing (24). It correctly returns after changing lineSpacing.

My code :

const { Text } = require(‘scenegraph’) ;

const textNode = selection.items[0] ;
console.log(textNode.lineSpacing) ;

Expected Behavior

24

Actual Behavior

0

@sttk3

Are you still seeing this issue? I’m unable to replicate this any more.

1 Like

Returning 0 for default is the expected behavior. See the docs: https://adobexdplatform.com/plugin-docs/reference/scenegraph.html#Text-lineSpacing.

It sounds like you might be interested in an API to get the overall font metrics of a Text object. Please upvote this request if so: Get font metrics.

1 Like

Thank you for contacting. I know that now.

lineSpacing was this rule.

  • If lineSpacing is 0 then it is AutoLeading
  • autoLeadingValue = Math.ceil(characterSize * 1.7)
  • If the line is blank, narrow spacing by half of character size

I’m not sure if it’s always going to be a * 1.7 multiplier by default… that might depend on each font’s individual metrics.

1 Like

It is a pity.
If the plugin can see graphicContent.agc directly, I can use the position and range of text.

I think line spacing is returning values now if it didn’t in the past.

1 Like

Thank you.

I’m sorry I made you spend time and effort.
To close the question, I need to flag the correct answer.