fix(tui/mermaid): add DejaVu/Liberation font fallback for Linux (#92)#179
Merged
Conversation
The terminal mermaid theme set `font_family` to "Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, sans-serif". On most desktop Linux distributions none of those names resolve to an installed font (Inter is rare, ui-sans-serif/system-ui are CSS-only, Segoe UI is Windows-only), so resvg's text rasterizer fell back to a font that lacked the glyphs jcode actually emits in node labels — labels rendered invisible inside the rendered PNG. Append "DejaVu Sans" and "Liberation Sans" to the family list. Both are part of `fonts-dejavu-core` / `fonts-liberation` which are pulled in by virtually every desktop Linux install. macOS and Windows still hit `-apple-system` / `Segoe UI` first, so this is purely additive. Ports upstream PR 1jehuang#108. Closes #92
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.
What
Mermaid diagram labels were invisible on Linux because the terminal theme's
font_familylisted onlyInter, ui-sans-serif, system-ui, -apple-system, Segoe UI, sans-serif— none of which resolve to an installed font on most Linux desktops, so resvg fell back to a font that lacked the needed glyphs.This addresses issue #92: #92
Changes
"DejaVu Sans", "Liberation Sans"toterminal_theme().font_family. Both ship with virtually every desktop Linux distribution; macOS and Windows still hit-apple-system/Segoe UIfirst, so the change is purely additive.Tests
cargo fmt --checkclean;cargo check -p jcode-tui-mermaidcompiles.Notes
Ports upstream PR 1jehuang#108.