Skip to content

Conversation

@DeeJayLSP
Copy link
Contributor

@DeeJayLSP DeeJayLSP commented Oct 1, 2025

Related to #111118 (part of it is most of this PR)
Closes godotengine/godot-proposals#9012.

Disclaimer

Some time ago I did a work to replace the default font with Inter. It is the font I have used in Godot since way before godot-minimal-theme was created.

I didn't make a pull request out of it as I thought a default theming change like this wouldn't be accepted before 5.0 or something, until #111118 appeared and included the same font change, which made me consider that the change is on the table now.

As I believe some things are better done separately, and also wanted to bring attention to certain OpenType features that improve readability, I opted to open this PR.

Description

Noto Sans' main point is that it covers a significant amount of glyphs and avoids displaying invalid characters, but that's only true if you're using all of its fallbacks.

Inter, on the other hand, is a typeface designed for most types of user interface, with many claims that its readability is much better than that of Noto Sans. FOSS projects like GNOME and Blender have adopted it.

This PR replaces the default Noto Sans font (but not its fallbacks) with the Inter font.

Additionally, I touched some OpenType features:
calt: Contextual alternates. Comes enabled by default in Inter, so it was disabled.
ss04: Enables serifed I and tailed l, which makes them better distinct as the default is literally indistinguishable.
tnum: Tabular figures. Enabling them makes numeric fields in the Inspector look better.

These are only applied if Main Font is unset and shouldn't carry over to custom fonts. They may be enabled/disabled through Main Font Custom OpenType Features by setting them to false (it's documented).

Using font feature freeze would imply modification by the terms of OFL, so to avoid having to manipulate copyright stuff, features gets set through code.

I got some pangrams and other examples in the editor for reference:

Before (Noto Sans):

image image image

After (Inter with disambiguation):

image image image

Considerations

Droid Sans, Roboto, Noto Sans and Inter all seem to be built on the same foundation, so metrics should be pretty much compatible.

In fact, Inter began as a superset of Roboto, which itself uses Noto Sans as a fallback on Android.

There are concerns about some concerns about some glyphs from Noto Sans missing in Inter, but those are usually not available in a keyboard.

@DeeJayLSP DeeJayLSP requested review from a team as code owners October 1, 2025 23:45
@DeeJayLSP DeeJayLSP force-pushed the gdinter branch 2 times, most recently from 9153ba9 to 63d55a7 Compare October 2, 2025 00:04
@YeldhamDev
Copy link
Member

I was the middle of adding the disambiguation on my PR as well. 😛 Surprised you also didn't use the Variable font here as you suggested there.

Also, wouldn't be better to enable even if a custom font is picked? It's probably desirable in that case too, and the Inter font would still keep it when it appears as a fallback.

@DeeJayLSP
Copy link
Contributor Author

DeeJayLSP commented Oct 2, 2025

Surprised you also didn't use the Variable font here as you suggested there.

It would be reasonable to do so if both Regular and Bold variants together weren't lighter than InterVariable.

Also, wouldn't be better to enable even if a custom font is picked? It's probably desirable in that case too, and the Inter font would still keep it when it appears as a fallback.

ss02 alternates between a set of glyphs and we're not always sure it is used for disambiguation for other fonts. Maybe it's possible to apply it just on this variation.

@DeeJayLSP
Copy link
Contributor Author

DeeJayLSP commented Oct 2, 2025

One thing bothering me, however, is how hinting messes up alignment with uppercase i, making it look like it's out of place:
image
image

This doesn't happen if hinting is disabled, or the font size is 13 or 15. Maybe we should disable disambiguation for it and keep for lowercase L? They would end up different anyway.

@Calinou
Copy link
Member

Calinou commented Oct 2, 2025

Note that you could use Adwaita Sans, which is Inter preconfigured to have disambiguation enabled: https://gitlab.gnome.org/GNOME/adwaita-fonts

There's also Adwaita Mono (a customized Iosevka) which could replace JetBrains Mono, as it's designed to pair well with Adwaita Sans.

@YeldhamDev
Copy link
Member

@Calinou I tried that on my PR initially, but it only has the Variable fonts, and they are in the ttf format.

@DeeJayLSP
Copy link
Contributor Author

but it only has the Variable fonts, and they are in the ttf format.

And while it's possible to convert them to woff2, its size would still be bigger than a Regular + Bold pair in the end.

@DeeJayLSP
Copy link
Contributor Author

DeeJayLSP commented Oct 2, 2025

Updated so it only touches the lowercase L like Adwaita Sans does (cv05). The other ones look too glitchy with the default editor font size and hinting on.

@YeldhamDev
Copy link
Member

Some more features have been suggested here: #111118 (comment)

cv02 - Open four
cv03 - Open six
cv04 - Open nine (maybe leave nine closed or leave six closed?)
cv05 - Lowercase L with tail
cv08 - Uppercase I with serif
cv09 - flat top three
tnum - Evenly spaced numbers, makes the interface less "jumpy". (example gif on the original discussion)

@DeeJayLSP
Copy link
Contributor Author

DeeJayLSP commented Oct 3, 2025

Some more features have been suggested here: #111118 (comment)

cv02 - Open four
cv03 - Open six
cv04 - Open nine (maybe leave nine closed or leave six closed?)
cv05 - Lowercase L with tail
cv08 - Uppercase I with serif
cv09 - flat top three
tnum - Evenly spaced numbers, makes the interface less "jumpy". (example gif on the original discussion)

I tested them before, and all of them showed the same buggy hinting as serifed uppercase i.

If you look closely, the problem even happens with lowercase L, except it's barely noticeable until you compare with a lower or higher size.

Copy link
Member

@YeldhamDev YeldhamDev left a comment

Choose a reason for hiding this comment

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

It's for the best if this one is merged before the new theme one.

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.

Tested locally, it works as expected. Code looks good to me.

Comparison with the current editor theme:

Before After
Before After

Copy link
Member

@akien-mga akien-mga left a comment

Choose a reason for hiding this comment

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

Seems fine to me. I'm cool with either font so I don't have a strong opinion for or against the change, but since it's a design choice for the new theme we're implementing, let's go with it.

We planned to merge this close to merging the new theme (in the same dev snapshot), so we get all visual changes in the same release.

@DeeJayLSP
Copy link
Contributor Author

DeeJayLSP commented Oct 10, 2025

One thing bothering me, however, is how hinting messes up alignment with uppercase i, making it look like it's out of place...

This doesn't happen if hinting is disabled, or the font size is 13 or 15. Maybe we should disable disambiguation for it and keep for lowercase L? They would end up different anyway.

In case we want those other variations, #111461 is mandatory.

EDIT: Apparently not, in case we use font feature freeze.

On the other hand, doing so implies modifying the font, which requires copyright info modification by the terms of OFL (at least Adwaita Sans, which is a font feature freeze by GNOME that only enables a character variant, does that).

With that said, I think it's better to wait for HarfBuzz auto-hinting.

@DeeJayLSP
Copy link
Contributor Author

DeeJayLSP commented Oct 11, 2025

There's also Adwaita Mono (a customized Iosevka) which could replace JetBrains Mono, as it's designed to pair well with Adwaita Sans.

Offtopic but, if we truly want a customized Iosevka, the best variant would probably be Iosevka SS14 Extended, which is customized to look like JetBrains Mono.

On the other hand, JetBrains Mono's WOFF2 file is 90.2KiB, while the average pre-compiled Iosevka WOFF2 won't be lower than 300 KiB. And comparing, I personally don't see any advantages.

@DeeJayLSP
Copy link
Contributor Author

DeeJayLSP commented Oct 14, 2025

With the issue with variant hinting gone, I have re-enabled serif uppercase i and slashed 0. Added more screenshots to the main comment.

The proposal suggests ss01 (all alternate digits), ss04 (I and l disambiguation without slashed 0) and tnum (tabular numbers). But for now, I'll just let the default disambiguation in unless someone really wants something else.

If anyone disagrees with slashed 0, we can just replace ss02 with ss04.

@DeeJayLSP
Copy link
Contributor Author

DeeJayLSP commented Oct 15, 2025

Decided to showcase variant candidates separately.

ss01 (alternate digits):
image

ss02 (serifed I, tailed l and slashed zero):
image

ss04 (same as ss02 but without slashed zero):
image

tnum (tabular numbers):
image

ss01 + ss02:
image

ss01 + tnum:
image

ss02 + tnum:
image

ss04 + tnum (current candidate):
image

ss01 + ss02 + tnum:
image

My personal opinion:

  • Uppercase i being serifed makes it closer to Noto Sans' which is serifed by default.
  • Either serifed uppercase i, or tailed lowercase L, or both, are desired, as the defaults are literally the same character.
  • Slashed zero only serves to further differentiate it from uppercase o. Fonts like JetBrains Mono do this by default, although with a dot in the middle instead of a slash. Could be desired too.
  • Tabular numbers might make number fields more consistent. Float sliders benefit from this.
  • Alternate digits is pretty much a stylistic choice, but could be better for reading due to looking unique compared to every other character.

If anyone else has a preference, I'm interested in hearing it.

@Calinou
Copy link
Member

Calinou commented Oct 15, 2025

I would go for ss02 + tnum personally. Tabular (= fixed-width) numbers will make many places in the editor look more consistent when values change, such as the View Information and View Frame Time panels in the 3D editor.

@Mickeon
Copy link
Member

Mickeon commented Oct 17, 2025

I personally don't like the slashed zero! I feel like there's very few places in the editor where the distinction between 0 and O matters, because the editor itself (outside of code) generally avoids this ambiguity. For example, "text" and "numbers" tend to be distinct from one another, and very few properties have a 0 in their names (and it hardly can be confused for a lone letter). With little benefit, the slash only makes the zero noisier.

@bruvzg
Copy link
Member

bruvzg commented Oct 17, 2025

Stuff like slashed zero probably should be configurable, we have editor option to set OpenType feature tags for the code font, so no reason not to have one for main font as well (but UI should be improved, currently it's just a text field).

@DeeJayLSP
Copy link
Contributor Author

DeeJayLSP commented Oct 17, 2025

I have updated so it only applies I and l disambiguation + tabular numbers for now. Slashed 0 removed.

If I were to add an option to set OpenType feature tags for the main font now, it would probably go beyond the scope of this PR. Tabular numbers would be quite easy to do as a drop down like code_font_contextual_ligatures as it has a predefined name. Edit: there is a Main Font Custom OpenType Features setting now.

@DeeJayLSP

This comment was marked as outdated.

@DeeJayLSP DeeJayLSP force-pushed the gdinter branch 2 times, most recently from b6cfff5 to 9e705d1 Compare October 21, 2025 19:03
@DeeJayLSP DeeJayLSP requested a review from a team as a code owner October 21, 2025 19:03
@DeeJayLSP DeeJayLSP changed the title Replace default editor font with Inter, disambiguation enabled Use Inter as the default editor font, features enabled Oct 21, 2025
@DeeJayLSP
Copy link
Contributor Author

DeeJayLSP commented Oct 21, 2025

As a follow-up of #111773, I added to Main Font Custom OpenType Features's documentation that Inter supports it, and which ones are enabled/disabled by default specifically by Godot.

Unless someone really wants changes, I'm considering this finished for now.

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.

Looks great now 🙂

For example, tabular numbers make the Frame Time panel look more stable over time:

frame_time_panel_tabular_numbers.mp4

Code looks good to me.

@Repiteo Repiteo merged commit 361ea11 into godotengine:master Oct 22, 2025
20 checks passed
@Repiteo
Copy link
Contributor

Repiteo commented Oct 22, 2025

Thanks!

@DeeJayLSP DeeJayLSP deleted the gdinter branch October 22, 2025 00:43
@DeeJayLSP DeeJayLSP restored the gdinter branch October 22, 2025 00:44
@DeeJayLSP DeeJayLSP deleted the gdinter branch October 22, 2025 00:44
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.

7 participants