Repository navigation
Use the Material Linux fallback font as the theme font on Linux - #2078
Merged
Merged
Conversation
After #2070, Latin text and shared punctuation on Linux use the Noto Sans CJK glyphs, so the dashes and quotes in Chinese text are full width. Before #2070 the theme kept the Material fallbacks for Linux ('Ubuntu', 'Adwaita Sans', 'Cantarell', 'DejaVu Sans' and others), and Latin text used the first installed one. #2070 replaced these fallbacks with the CJK and emoji families. 77b8484 restored 'Roboto' as the main family, but 'Roboto' is not installed, so the CJK family still draws Latin text. Resolve the Material Linux fallbacks with fc-match and use the result as the theme family. Keep the CJK and emoji families as fallbacks. The main family is installed, so the first layout does not search for the missing 'Roboto'.
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The focused change preserves existing font precedence and platform behavior, with no blocking issues identified.
No open issues 🎉
What changed in this PR
Restores Linux’s Material fallback font as the theme’s main font, correcting Latin text and punctuation rendering while retaining CJK and emoji fallbacks.
Changes:
- Resolves an installed font from Material’s Linux fallback list.
- Uses the same main font for theme text and font warmup, preserving loaded-font precedence.
| File | Description |
|---|---|
lib/utils/system/system_fonts.dart |
Resolves and applies the Linux main font consistently. |
Review effort: Balanced
boyan01
approved these changes
Oct 21, 2026
The CJK fonts have black and white glyphs for some emoji, for example U+1F17F. With the CJK family first, these emoji lost their color, but they were in color before #2070.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
After #2070, Latin text and shared punctuation (
—,“ ”) on Linux use the Noto Sans CJK glyphs, so the dashes and quotes in Chinese text are full width.Before #2070, the theme kept the Material fallbacks for Linux ('Ubuntu', 'Adwaita Sans', 'Cantarell', 'DejaVu Sans', …), and Latin text used the first installed one. #2070 replaced these fallbacks with the CJK and emoji families. 77b8484 restored 'Roboto' as the main family, but 'Roboto' is not installed, so the CJK family still draws Latin text.
Typography.material2021(platform: TargetPlatform.linux), so it is not copied into the app._warmLinuxFontswarms the same main family.Evidence
Arch Linux, system language en_US. A small entry point renders fixed sample text (English, Chinese, mixed, emoji with and without U+FE0F, CJK symbols; weights 400, 500, 700; app locale zh_CN and en_US) with the app's
loadFallbackFonts()andwithFallbackFonts()from each version:—and“ ”. The two are pixel-identical.After: text and punctuation are the same as the version before Keep desktop frames within the 120 Hz budget #2070 (594e4dd^). The emoji rows are also the same. Only ㊗ ㊙ 〰 〽 differ, as described above.
Each image: app locale zh_CN (top) and en_US (bottom); bodyMedium 400, bodyMedium 500 and titleMedium 700.
flutter analyze: no issues.flutter test: 327 passed.Not tested on Ubuntu.
Merge Danger
Door: two-way
Blast Radius: Linux text
Only Linux changes. With a non-English system language, the theme still uses the font family that the app loads from fc-match.