The drawing of fonts is slightly wrong

Godot Version

2.4.1.stable unofficial flatpak on SteamOS

Question

Hi all,
I have drawn a ttf font specifically designed to draw at 20 pixels high. I’ve used it in other engines with no problems but Godot obscures the raster grays in oblique lines making the font look pretty bad.
image
upper → Godot
lower → spected
As the image shows, Godot darkens the gray pixels a lot, on the order of 50 byte units.
I have tried forcing ‘light hinting’ in the font import settings, but there is no visible change.
I have tried modifying the ‘Embolding’ parameter of a ‘FontVariant’, but it also modifies the font spacing resulting in worse rendering.

I can’t find any other parameter that allows me to modify how the font is rasterized.
Any hints?
Thanks in advance from a pixel perfect maniac :smiley:

It kind of looks like it’s being rendered in a different color space than you’ve seen before, like it’s supposed to be rendering using linear space, but it’s currently in gamma in godot, etc.

Not sure if that is a property for font rendering, but I wonder.

1 Like

Thank you. That is something i did not think on. I will take a look

Ok. I found the problem. The shadow is drawn on each glyph even if its value is null. I have set a totally transparent color to the shadow and problem fixed.

1 Like

Nice find!