Skip to content

Add warning when system font fallback is used. #107016

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bruvzg
Copy link
Member

@bruvzg bruvzg commented Jun 1, 2025

Adds warning displayed when system fallback font is used, warning can be disabled from the project settings, only enabled for debug builds, and by default is displayed only when running from editor with attached debugger. It is not displayed when system fonts are used directly (using SystemFont class).

Warning include used system font and text string that triggered it (without duplication):

Screenshot 2025-06-01 at 16 32 53

System font fallback is useful, but is a constant source of confusion, since different platforms have different fallback capabilities and sets of available fonts.

See following issues for example, there are multiple other similar issues:
#106824
#84590
#78921
#77903

@bruvzg bruvzg marked this pull request as ready for review June 1, 2025 21:02
@bruvzg bruvzg requested review from a team as code owners June 1, 2025 21:02
Comment on lines +684 to +686
<member name="debug/settings/ui/show_system_font_fallback_warnings" type="int" setter="" getter="" default="1">
If enabled, produces a warning when system font fallback is used.
</member>
Copy link
Member

@Calinou Calinou Jun 3, 2025

Choose a reason for hiding this comment

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

The enum setting can be replaced with just a boolean that defaults to false, and is overridden to true for the editor_runtime feature tag.

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.

I agree about having a project setting to disable it, since there are many cases where the warning isn't relevant (non-game applications, or demos like BiDi and Font Features).

@Repiteo Repiteo modified the milestones: 4.5, 4.x Jun 16, 2025
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