Repository navigation
Fonts: find the cell, serif, mono, Thai and Hebrew faces in Fedora's package folders (#1694) - #1705
Merged
Conversation
…package folders (storytold#1694) Fedora keeps each font family in its own package folder, and the cell, serif, mono, Thai and Hebrew candidates only listed the Debian/Ubuntu/Arch folders, so no cell face was found there and bold and italic cells drew as regular text in the built-in font. Add Fedora's folders after the existing Linux entries for each font, as storytold#54 did for the UI fonts, and let mono fall back to Liberation Mono and then Fedora's default Noto Sans Mono, since DejaVu Sans Mono is optional there. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Independent verification, since this has been open a few days with no review — this matches the exact pattern I've been looking at today in pdfcraft (Hebrew/Thai system-font fallback bugs, storytold/pdfcraft#1624 and #792). Applied cleanly on current
I don't have a Fedora box to confirm the actual |
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.
Part of #1694 (problem 1, except CJK).
On Fedora the cell font roles in
crates/ui-egui/src/theme.rsfind no face. Fedora keeps each family in its ownpackage folder (
google-carlito-fonts/,liberation-sans-fonts/…), and the roles only list the Debian/Ubuntu/Archfolders. Every cell then falls back to egui's built-in proportional font, which has one weight and no italic, so bold
and italic cells draw as regular text. Serif and monospace cells use the built-in faces, and Thai and Hebrew are boxes.
The UI roles already have Fedora's folders (#54, #298). This adds them to the other roles, each after the existing
Linux entries for the same font:
google-carlito-fonts/Carlito-*.ttf,liberation-sans-fonts/,dejavu-sans-fonts/.liberation-serif-fonts/LiberationSerif-Regular.ttf,dejavu-serif-fonts/DejaVuSerif.ttf.dejavu-sans-mono-fonts/DejaVuSansMono.ttf. Fedora installs DejaVu Sans Mono only on request, so twofallbacks follow: Liberation Mono (
<dir>/liberation/andliberation-mono-fonts/), which comes with LibreOffice(a default group in Workstation and KDE), and last Fedora's default monospace, the variable
google-noto-vf/NotoSansMono[wght].ttf.google-noto-vf/NotoSansThai[wght].ttfandNotoSansHebrew[wght].ttf.The Noto variable fonts all default to
wght400 (Regular; read from theirfvar), so they need noFontTweak.One change outside Fedora: the generic
<dir>/liberation/LiberationMono-Regular.ttfentry also matches other layouts.A system with Liberation Mono there but no DejaVu Sans Mono at a listed path now draws mono cells in Liberation Mono
instead of egui's built-in mono. Wherever an existing entry already matched, nothing changes.
Left for separate PRs:
LINUX_CJK_DIRS, and Fedora'sgoogle-noto-sans-cjk-fontsandgoogle-noto-sans-cjk-vf-fontsare in neither it nor
main. The variableNotoSansCJK-VF.ttcalso needswght400, or it draws Thin (Linux (Fedora): cell fonts not found, so bold/italic are never shown; serif, mono, Thai and CJK fall back #1694 problem 4).wghtcoordinate per role.How tested:
theme::tests::fedora_package_folders_are_searched_after_the_other_linux_layoutschecks that each role listsFedora's file for its face, after the existing Linux entries for the same font, and that the mono fallbacks come
after DejaVu Sans Mono. It fails on
main("cell: Fedora's google-carlito-fonts/Carlito-Regular.ttf is not acandidate") and passes with this change.
/usr/share/fonts, with a sheet in Calibri, Arial, Times New Roman, Courier New and Cambria, regular, bold, italic andbold italic, plus Thai, Hebrew and CJK text:
google-carlito-fonts): onmain, a bold Calibri cell has thesame number of dark pixels as the regular one (126 and 126). With this change it has 144 and 239, and italic is
slanted. Serif cells use Liberation Serif, mono cells Liberation Mono, and Thai and Hebrew draw.
mainexcept Courier New, which moves from thebuilt-in mono to Liberation Mono, because that layout has no DejaVu Sans Mono.
cargo xtask ci: all 8 steps pass (fmt, clippy, test, assets, layers, wasm, parity, keytips); 1610 tests, 0 failed.🤖 Generated with Claude Code