Hi there, I wanted to document some behaviors of Line Spacing in TouchDesigner as I didn’t find any in depth discussion of the behavior outside of the documentation. The behavior in TD does not match the typical behavior of line spacing in other software which makes it cumbersome to do typesetting.
Line-height, line spacing, and leading are all synonymous in the context of digital design software and are defined as:
Leading (or line height) is the vertical distance between lines of text. More precisely, the distance between their baselines (from one line’s baseline to the following line’s baseline). In simple words, it is line spacing familiar to almost everybody.
Source
I’ve made a file with a few examples to try and document how Line Spacing functions in TD and compare it to line-height in CSS. CSS mimics how line spacing works in design software (for the most part) so that was an easy way to compare.
Examples C1 and C2
These confirm the behavior of Line Spacing on a Text TOP being
Determines the amount of space between lines of text.
When the Line Spacing parameter on the Text TOP is 0 the line spacing comes out to be 1.072 (107.2%) which you can see in example C2.
Examples A1 and A2
These compare Text TOP to how the web renders text. A1 uses Verdana and A2 uses Arial. Verdana needs a -3px Line Spacing to match 40px line-height in CSS (which is the same 1.072 value seen in example C2) and Arial needs -3.576px Line Spacing.
Example B
This example shows the behavior of the Text OP. It needs a Line Spacing of 0.831 to match line-height 1 in CSS.
Summary
I’d be curious if there is any further info around how line spacing is handled in TD. None of the above examples are bugs but they do make doing typesetting in TD cumbersome and requiring a lot of trial and error. I also filed a bug around Line Spacing units here. I have a bunch of TD programs that do dynamic text layouts and it’s hard to make them scale nicely without the line spacing getting out of whack.
Thanks!
LineSpacingTest.toe (10.4 KB)