Font has uneven spacing for seemingly no reason

Godot Engine v4.2.2.stable.official.15073afe3

I’m making a custom font using this website, and for some reason when using the .ttf file in Godot, the text is unevenly spaced. There should be a one pixel gap between white and black of the numbers, and a two pixel gap before and after the semi colon, but this just doesn’t happen. What’s more, when looking at the 3s and 4s, their spacing is completely inconsistent. What is going wrong here, and how can I fix this?

JSON file:

.ttf file:

(JSON file can be imported into website with top left “Menu” button –> import settings.)

you might have the font at the wrong size.

I’ve experimented with size and this is for sure the right size. Anything else is completely blurry.

The link in your original post leads to an error page

I tried your font with just released Godot 4.6. Character spacing seems to fine with font size 8. Anything smaller and it breaks. Size 9 also doesn’t work but larger values seem to be fine. I also tried another small font, Tiny5 from Google Fonts, and it works similarly. If the font size is too small, character spacing break.

I guess this might have something to do with Godot using integers with character spacing. You can have spacing of 1 or 2, but not 1.5. There are some issues and draft in Github for adding float support, but it doesn’t seem that this is going to be fixed soon.

1 Like