Skip to content

Add Linux font fallbacks for Mermaid SVG text rendering #371

Closed

Description

@1jehuang

crates/jcode-tui-mermaid/src/mermaid_content.rs font stack lacks Linux-native fallbacks (DejaVu Sans, Liberation Sans), which can produce invisible/missing Mermaid labels with resvg on Linux.

Credit: originally proposed in PR #108. This repo no longer accepts external PRs, so the problem is tracked here instead.

Activity

  1. added
    from-pr
    on Jun 12, 2026
  2. added
    triage: reproducible
    autonomous: likely
    priority: low
    on Jun 25, 2026
  3. 1jehuang commented on Jun 25, 2026

    @1jehuang
    OwnerAuthor

    Triage: confirmed in crates/jcode-tui-mermaid/src/mermaid_content.rs:267 (terminal_theme). The font stack is "Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, sans-serif" with no Linux-native fallbacks (DejaVu Sans, Liberation Sans). resvg resolves fonts via a fontdb loaded with load_system_fonts() (lib.rs:422-426), and the primary family is picked as the first comma-entry (mermaid_svg.rs:primary_font_family, defaulting to "Inter"). On Linux systems without Inter/Segoe UI installed, label text can fail to resolve a glyph face and render missing/invisible.

    Fix path: add DejaVu Sans / Liberation Sans (and Noto Sans) to the family list so a commonly-installed Linux face is matched. Low-risk, localized; autonomous: likely.

  4. 1jehuang commented on Jun 25, 2026

    @1jehuang
    OwnerAuthor

    Fixed in b96dfa47 (pending release). Built and tests pass on Linux. See commit message for the specific change for this issue.

  5. added
    triage: fixed-pending-release
    and removed
    triage: reproducible
    on Jun 25, 2026
  6. 1jehuang commented on Jun 28, 2026

    @1jehuang
    OwnerAuthor

    Released in v0.32.0. Run jcode update to get it.

  7. removed
    triage: fixed-pending-release
    on Jun 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    autonomous: likelyfrom-prpriority: low

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions