Skip to content

Conversation

DeeJayLSP
Copy link
Contributor

@DeeJayLSP DeeJayLSP commented Sep 20, 2025

Fixes #110426

During #106217's writing I was unaware that if the editor's Main Font Bold was unset, it would take the Main Font and embolden it.

In that situation, the weight would be set to bold and the embolden process would happen at the same time, resulting in a very heavy and blurry font.

This changes so emboldening won't happen if the font is variable, as by default, the bold font will be set to have a bold weight.

  • Inter Variable set on both Main Font and Main Font Bold:
image
  • Inter Variable set on Main Font, Main Font Bold unset, before fix:
image
  • Inter Variable set on Main Font, Main Font Bold unset, after fix:
image

@DeeJayLSP DeeJayLSP requested review from a team as code owners September 20, 2025 22:38
Copy link
Contributor

@Maran23 Maran23 left a comment

Choose a reason for hiding this comment

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

Can confirm that this fixes the issue!

Fix makes sense.
I wondered what the magic number 2003265652 stood for. It turns out that it refers to the weight. I wonder if we should create a constant with a good name for it. Let's see what the folks at Godot have to say about it. :)

@AThousandShips AThousandShips added bug regression topic:gui cherrypick:4.5 Considered for cherry-picking into a future 4.5.x release labels Sep 22, 2025
@AThousandShips AThousandShips added this to the 4.6 milestone Sep 22, 2025
@DeeJayLSP DeeJayLSP force-pushed the no-embolden-when-variable branch from f813792 to d719fc7 Compare September 22, 2025 13:35
Copy link
Contributor

@Maran23 Maran23 left a comment

Choose a reason for hiding this comment

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

Can confirm that this still works.

In the code, I saw also calls looking like this name_to_tag("weight"). Is there a difference between "wght"?

@DeeJayLSP
Copy link
Contributor Author

DeeJayLSP commented Sep 22, 2025

In the code, I saw also calls looking like this name_to_tag("weight"). Is there a difference between "wght"?

From what I've seen in the code, name_to_tag() is supposed to work with four character OpenType tags, discarding the rest.

Whether those are wrong or not, that's unrelated to this PR and probably a case for another PR or issue.

Edit: I have been corrected in the comment below.

@bruvzg
Copy link
Member

bruvzg commented Sep 22, 2025

name_to_tag works with 4 letter string codes and a set of default names (see https://github.com/godotengine/godot/blob/master/modules%2Ftext_server_adv%2Ftext_server_adv.cpp#L536). The returned tag is uint32_t (contains the same 4 ASCII letter code in memory).

Copy link
Member

@Calinou Calinou left a comment

Choose a reason for hiding this comment

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

Code looks good to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug cherrypick:4.5 Considered for cherry-picking into a future 4.5.x release regression topic:gui
Projects
None yet
Development

Successfully merging this pull request may close these issues.

InterVariable font looks a bit blurry in the Editor
5 participants