lineSpacing not updating

Hi guys,

i have two examples of line-height that doesn’t get the correct value. in both it seems like the lineSpacing is 0, although it really isn’t (i am using layers for developers to check the lineSpacing property)

attached the xd files.example 1example 2

1 Like

I inspected the “lineSpacing” property values in your two documents, and I also see them as zero. I do not think that should be the case. I logged a bug with our team. Thanks!

1 Like

I am experiencing the same issue with lineSpacing

I discussed this with the developer, and the response was this was the expected behavior and is documented here:

The special value 0 causes XD to use the default line spacing defined by the font given the current font size & style.

So basically values seen in the XD GUI for shapes are often a calculation based on the shape’s context. For text the context is to calculate line spacing based on the font size. However values reported by the plugin APIs tend to be “raw” values that are placed on nodes. So if I change the font size of some text, the line spacing reported in the GUI will also update relatively, but the “lineSpacing” reported by the plugin API will continue to be zero. And if I explicitly set the Line Spacing in the GUI to a new value, that same value will be reported by the plugin API because it overrides the default value. I hope that explains things.