# \[Bug report\] lineSpacing

**URL:** <https://forums.creativeclouddeveloper.com/t/bug-report-linespacing/247>\
**Category:** UXP Plugin API\
**Tags:** api-feedback\
**Created:** [October 21, 2018, 9:36am UTC](https://forums.creativeclouddeveloper.com/t/bug-report-linespacing/247 "2018-10-21T09:36:38Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![sttk3](https://avatars.discourse-cdn.com/v4/letter/s/958977/32.png) [@sttk3](https://forums.creativeclouddeveloper.com/u/sttk3)\
**Post date:** [October 21, 2018, 9:36am UTC](https://forums.creativeclouddeveloper.com/t/bug-report-linespacing/247/1 "2018-10-21T09:36:38Z")

</div>

### 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

---

<div class="post-metadata">

**Author:** ![stevekwak](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/stevekwak/32/48_2.png) [@stevekwak](https://forums.creativeclouddeveloper.com/u/stevekwak)\
**Post date:** [April 2, 2019, 10:31pm UTC](https://forums.creativeclouddeveloper.com/t/bug-report-linespacing/247/2 "2019-04-02T22:31:00Z")

</div>

@sttk3

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

---

<div class="post-metadata">

**Author:** ![peterflynn](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/peterflynn/32/56_2.png) [@peterflynn](https://forums.creativeclouddeveloper.com/u/peterflynn)\
**Post date:** [April 3, 2019, 6:29pm UTC](https://forums.creativeclouddeveloper.com/t/bug-report-linespacing/247/3 "2019-04-03T18:29:15Z")

</div>

Returning `0` for default is the expected behavior. See the docs: [https://adobexdplatform.com/plugin-docs/reference/scenegraph.html#Text-lineSpacing](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](http://forums.creativeclouddeveloper.com/t/get-font-metrics/670).

---

<div class="post-metadata">

**Author:** ![sttk3](https://avatars.discourse-cdn.com/v4/letter/s/958977/32.png) [@sttk3](https://forums.creativeclouddeveloper.com/u/sttk3)\
**Post date:** [April 4, 2019, 12:14pm UTC](https://forums.creativeclouddeveloper.com/t/bug-report-linespacing/247/4 "2019-04-04T12:14:22Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![peterflynn](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/peterflynn/32/56_2.png) [@peterflynn](https://forums.creativeclouddeveloper.com/u/peterflynn)\
**Post date:** [April 4, 2019, 11:28pm UTC](https://forums.creativeclouddeveloper.com/t/bug-report-linespacing/247/5 "2019-04-04T23:28:30Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![sttk3](https://avatars.discourse-cdn.com/v4/letter/s/958977/32.png) [@sttk3](https://forums.creativeclouddeveloper.com/u/sttk3)\
**Post date:** [April 5, 2019, 11:12pm UTC](https://forums.creativeclouddeveloper.com/t/bug-report-linespacing/247/6 "2019-04-05T23:12:38Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Velara](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/velara/32/1278_2.png) [@Velara](https://forums.creativeclouddeveloper.com/u/Velara)\
**Post date:** [May 17, 2019, 1:22am UTC](https://forums.creativeclouddeveloper.com/t/bug-report-linespacing/247/7 "2019-05-17T01:22:38Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![sttk3](https://avatars.discourse-cdn.com/v4/letter/s/958977/32.png) [@sttk3](https://forums.creativeclouddeveloper.com/u/sttk3)\
**Post date:** [May 22, 2019, 6:10am UTC](https://forums.creativeclouddeveloper.com/t/bug-report-linespacing/247/8 "2019-05-22T06:10:18Z")

</div>

Thank you.

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

---

<div class="post-metadata">

**Author:** ![konukselim](https://avatars.discourse-cdn.com/v4/letter/k/46a35a/32.png) [@konukselim](https://forums.creativeclouddeveloper.com/u/konukselim)\
**Post date:** [November 12, 2020, 11:42am UTC](https://forums.creativeclouddeveloper.com/t/bug-report-linespacing/247/9 "2020-11-12T11:42:24Z")

</div>

Hi,

I am experiencing the same issue. Getting line-spacing as 0 from the plugin but on my xd document, when I inspect, I see line-spacing value there. I don’t explicitly set a value for line-spacing but I want to get the default value.

Could you please help me getting default line spacing value?

---

<div class="post-metadata">

**Author:** ![sttk3](https://avatars.discourse-cdn.com/v4/letter/s/958977/32.png) [@sttk3](https://forums.creativeclouddeveloper.com/u/sttk3)\
**Post date:** [November 14, 2020, 12:28am UTC](https://forums.creativeclouddeveloper.com/t/bug-report-linespacing/247/10 "2020-11-14T00:28:26Z")

</div>

I don’t know how to get the default value for line spacing, but the actual line spacing can be obtained as follows.

1. Export the target text as svg
2. Calculate the difference between the **y** attribute of the **tspan** tag

You can find the corresponding source code in [Split Rows](https://xd.adobelanding.com/en/xd-plugin-download/?name=276c46a9).
