Gui text appearing all on one line

My help screen has 3 short paragraphs of text which I’m setting using gui.set_text in the init function of my gui script.

The ‘line break’ box is ticked in the relevant node but the text is displaying all on one line over the top of itself.

I would appreciate any suggestion y’all might have. It’s probably just something silly I’ve forgotten.

Code

gui.set_text(gui.get_node("text"), "Paragraph 1\n\nParagraph 2\n\nParagraph 3")

Resulting display

Do you perhaps have Text Leading set to a negative value (equal to the height of the font)?

1 Like

Thanks for the suggestion @britzl . I think I’ve just got a buggy font; swapping in a standard Arial font works fine.

The font I was using was manifesting other issues such as ignoring pivot values as well as not line breaking.

Here’s the dodgy font in question if anyone wants to investigate.

buggy_font.zip (5.8 KB)

Hmm, ok, I would have thought that the spacing between lines was determined by the font height set in the .font file, but I might be wrong. @Mathias_Westerdahl will be able to tell us how it actually works tomorrow.

The line height is usually calculated from the maxAscent and maxDescent, which are in turn calculated when loading a font with a certain size. However, there are a many font tools out there, and there’s also some artistry required to fill in all info in a font. When loading this font in FontBook (Mac OS), it complains about the “hhea” table, which is responsible for the horizontal metrics.

2 Likes