Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Font Hinting (or positioning) seems slightly off. #90779

Open
jitspoe opened this issue Apr 17, 2024 · 0 comments
Open

Font Hinting (or positioning) seems slightly off. #90779

jitspoe opened this issue Apr 17, 2024 · 0 comments

Comments

@jitspoe
Copy link
Contributor

jitspoe commented Apr 17, 2024

Tested versions

4.2.1 stable

System information

Windows 10, Vulkan forward +, Nvidia 3070

Issue description

When using a strongly hinted font, such as Tahoma, where the vertical lines should be pixel perfect, I've noticed that I can't seem to get pixel perfect hinted fonts in Godot.

Here are the import settings I'm using, which should be pixel perfect for a font at size 24:
image

If you zoom in, you can see the vertical lines are not pixel perfect:
image

Though the horizontal lines do seem correct, which makes me wonder if the font is actually importing properly, but being positioned off pixel horizontally when displayed in the controls.

For comparison, this is how the font looks in the ttf viewer in Windows:
image

And zoomed in:
image

Notice everything is pixel perfect here for the vertical and horizontal lines with font size 24.

Steps to reproduce

Use a font that has strong hinting, such as Tahoma.
In the import settings, set hinting to "Normal".
Might need to set subpixel positioning to "Disabled" (didn't seem to change anything, but I've heard it helps).
Use the font in a theme and set it to one of the sizes that hints well, like 24 or 12.

Minimal reproduction project (MRP)

test_font_hint(add own tahoma.ttf).zip

I've included a test project, but you will have to supply your own copy of tahoma.ttf, as I don't think it's legal to redistribute it. Should be on any copy of Windows, though. I couldn't find another font that had hinting this strong to use as an example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants