Editor / engine rendering of space char

It seems to me that the editor and the engine renders the space char (U+0020) in different way.

For example “Enter your name” in the editor is using the correct space I designed in the font. In the engine the same label has really wide spaces.

I am typing the same exact words in the editor and in the code for the label.set_text. Do you think that lua is not using U+0020 for space?

Thanks!

We recently did a change to how trailing whitespace are handled, but this is probably something else if it’s the width of the space character in between words that is rendered differently.

Yes, I are right. I am having problem with spaces between words.

I am going to check with a different font.

EDIT: With a .ttf the spaces are coherent but with an .otf font (same latins glyphs) they are NOT coherent.

I have solved this by setting the width of all 15 (fifteen!) different spaces of the font to the same value. It seems to me that the editor and the engine are using a different unicode (at least with my otf file exported with Glyphs).

1 Like

I think I have found the problem. I had a similar issue with all the Cyrillic glyphs having extreme wide spaces. I modified the font but the glyphs was still wide in the game. So I did a Rebuild and the engine created again the font metric, while a simple Build did not, and the spaces are now correct.

At least, this is what I guess.

Ciao!

1 Like