Skip to content

Linux: CJK/Thai/Indic text does not render even with matching system font installed #5991

Description

@nibbbl

Environment

Any recent viewer build on Linux (Official, Firestorm, etc.)

Description

On linux, text in Japanese, Chinese and other non-Latin scripts renders as empty squares / tofu boxes even when the system has the correct font installed (ex. Noto Sans CJK.)

The cause of this appears to be that the viewer uses a max_font_count_cutoff of 40 when building the list used by LLWindowSDL::getDynamicFallbackFontList(), which cuts off the list before a valid font is found. (Fonts like CJK can often appear at indexes of 180th or so.)

Possible Solutions

There's a few possible approaches to address this issue:

  1. Expand the limit - Bump the limit from 40 to a high value such as 400
  2. Explicitly query FontConfig for its best match for a fixed set of major scripts
  3. Lazy-load on demand - pull in fonts on demand if characters are missing

Reproduction steps

Given: You are running a Linux build of Second Life

  1. Log in
  2. View Japanese/Chinese/Thai font

Expected: The font should be rendered
Actual: The font is rendered with placeholder boxes

Screenshots

Image

Broken text in nearby chat

Image

Broken text in the Friend List

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinglinuxtriageFlags issues that need to be triaged

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions