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

Use Light hinting for DynamicFonts by default #43213

Closed

Conversation

Calinou
Copy link
Member

@Calinou Calinou commented Oct 30, 2020

This results in a smoother appearance for fonts. Most operating systems use a variant of Light font hinting by default, so this makes Godot match the OS behavior better. The editor uses Light font hinting by default since 3.2.

Since changing the font hinting mode can change font metrics slightly, complex GUIs may require some modifications to look correct again.

This results in a smoother appearance for fonts. Most operating systems
use a variant of Light font hinting by default, so this makes Godot match
the OS behavior better.

Since changing the font hinting mode can change font metrics slightly,
complex GUIs may require some modifications to look correct again.
Copy link
Member

@bruvzg bruvzg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The editor uses Light font hinting by default since 3.2.

Except for macOS, where hinting is disabled, for some reason.

Since changing the font hinting mode can change font metrics slightly.

I do not think it is affecting advances, only metrics of the individual glyphs, at least HarfBuzz seems to internally use FT_LOAD_DEFAULT | FT_LOAD_NO_HINTING for all metrics. Size of complete strings should remain the same.

On a hiDPI screen I do not see much difference between different hinting settings, and do not have any preferences.

I'll change default setting in the #41100, to be the same (previously, it was disabled by mistake, because I only looked to macOS default).

@Calinou
Copy link
Member Author

Calinou commented Nov 2, 2020

Except for macOS, where hinting is disabled, for some reason.

I implemented that in #31375 to better match the OS default.

@akien-mga
Copy link
Member

Can you show how it looks like on a couple example fonts / UIs (before/after)?

I'm OK with the change but it's hard to assess as is. That being said the editor font hinting looks good to me on Linux.

@Calinou
Copy link
Member Author

Calinou commented Nov 16, 2020

test_font_hinting.zip

Light hinting on top, normal hinting on the bottom:

image

It does change the font's metrics a little (tested with Cooper Hewitt Book), so it makes sense to merge this only in master without cherry-picking it to 3.2.

@Calinou
Copy link
Member Author

Calinou commented Dec 16, 2020

The default font hinting was changed to Light in #41100, closing.

@Calinou Calinou closed this Dec 16, 2020
@Calinou Calinou removed this from the 4.0 milestone Dec 16, 2020
@Calinou Calinou deleted the dynamicfont-default-light-hinting branch March 31, 2021 09:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants