Skip to content

fix(pico4-base): the Noto face of each language, and a CJK/Arabic fallback for mixed-language content - #39

Merged
Xenolphthalein merged 3 commits into
overpressure:mainfrom
PigeonOuyang:fix/language-fonts
Nov 24, 2026
Merged

Xenolphthalein merged 3 commits into
overpressure:mainfrom
PigeonOuyang:fix/language-fonts

Conversation

@PigeonOuyang

@PigeonOuyang PigeonOuyang commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Problem

After #38, CJK text is no longer tofu, but the faces are still wrong:

  • Simplified Chinese, Traditional Chinese and Korean use the Japanese Noto Sans CJK JP face;
    characters such as 骨直具者每海角内化令今冷低画界茶步 render with Japanese forms.
  • Arabic uses Noto Nastaliq Urdu (Urdu calligraphic style) instead of Naskh, so the Steam UI's
    Arabic text is slanted/stacked.

The current and preferred CJK and Arabic faces

The current block is what fontconfig picks today: Noto Sans CJK JP for the Han characters and
Noto Nastaliq Urdu for the Arabic. The preferred block is what the new rules select: Noto Sans
CJK SC and Noto Sans Arabic.

Cause

The Steam UI sets <html lang="zh-cn"> (Chinese), "ko" (Korean) or "ar" (Arabic); fontconfig's
generic families do not use that language, so they take the first covering face (JP / Nastaliq).
The same happens to mixed content: a Chinese game title in an English UI has lang=en.

Change

  • Add phoenix/pico4-base/67-pico4-language-fonts.conf, installed to /etc/fonts/conf.d/.
  • Per-language rules: zh-cn -> Noto Sans CJK SC; zh-tw -> TC; zh-hk -> HK; ja -> JP;
    ko -> KR, for sans-serif, Noto Sans, serif and monospace; ar -> Noto Sans Arabic
    for sans-serif and Noto Sans.
  • Mixed-language fallback: append Noto Sans CJK SC and Noto Sans Arabic weakly after the
    Latin families; an ur rule keeps Noto Nastaliq Urdu.
  • pico4-base 2026.11.24; the file is in source, sha256sums and backup.

Verification (PICO 4)

  • fc-match before/after:
    • sans-serif:lang=zh-cn: Noto Sans CJK JP -> Noto Sans CJK SC
    • serif:lang=zh-cn: -> Noto Serif CJK SC
    • monospace:lang=zh-cn: -> Noto Sans Mono CJK SC
    • zh-tw -> TC; ja -> JP; ko -> KR; ar -> Noto Sans Arabic; ur -> Noto Nastaliq Urdu
    • lang=en keeps Noto Sans as the primary family
  • The actual Steam UI reports document.documentElement.lang zh-cn / ko; a Chinese text
    node's platform font is Noto Sans CJK SC (NotoSansCJKsc-Regular).
  • A mixed page under lang="en": the English row keeps the Latin family; the Chinese title and
    the Arabic text take the faces shown below.
  • python -m unittest -v: 30 OK (3 skipped on Windows, CI covers them); python build/versions.py check: OK.

Mixed-language fallback

The language rules follow the element's lang; a Chinese game title in an English UI still has
lang=en. The config appends Noto Sans CJK SC and Noto Sans Arabic as weak fallbacks after
the Latin families: the English text keeps its Latin family, CJK and Arabic content in an English
UI gets the Simplified Chinese and Naskh faces. The language rules above keep their own face
first, and an ur rule keeps Nastaliq.

Before: a mixed page under lang="en" (Chinese in the JP face, Arabic in Nastaliq).

Mixed-language content before the fallback

After: the same page with the fallback.

Mixed-language content after the fallback

Every Steam UI script under lang="en": Thai, Hebrew, Hindi, Greek, Russian, Vietnamese and
emoji render with the Noto fonts already in the image.

Every Steam UI script under lang="en"

Japanese and Korean keep their Kana and Hangul; their shared Han characters take the Simplified
Chinese forms, the product's Chinese-primary fallback. Exact Japanese/Korean Han variants in
mixed content need the content's own language tag; fontconfig cannot tell a Han character's
language from its codepoint.

Note

The CJK preferences need the noto-fonts-cjk package from #38; Arabic uses the existing
noto-fonts.

Size

A few KB; no image size impact.

@PigeonOuyang
PigeonOuyang requested review from a team as code owners November 24, 2026 09:27
@Xenolphthalein

Copy link
Copy Markdown
Contributor

Thanks @PigeonOuyang, the before/after image makes the problem obvious, and checking the face in Steam's own CEF (NotoSansCJKsc-Regular for a zh-cn text node) is exactly the right proof.

I checked what SteamOS does here: Holo's noto-fonts-cjk ships no fontconfig rules at all, so there's no stock rule to follow, and a rule of our own is the way. Yours tests the same families Steam's stack falls back to (Noto Sans, then the generic ones), and the file's checksum in the recipe matches.

One thing I changed on your branch (d22dffa): the project's own packages take the date of their change as pkgver, so pico4-base is now 2026.11.24-1 rather than 2026.11.23-2.

I've started CI. Once it's green, this goes in, and a packages release with #38 and #39 follows, pinned in phoenix.

@PigeonOuyang PigeonOuyang changed the title fix(pico4-base): take the Noto CJK face of the text's language, and Noto Sans Arabic for Arabic fix(pico4-base): the Noto face of each language, and a CJK/Arabic fallback for mixed-language content Nov 24, 2026

@Xenolphthalein Xenolphthalein left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The language rules and the fallback both match PICO OS's own fonts.xml (zh-Hans first for Han, Naskh for Arabic); checksum and version checked, CI green.

@Xenolphthalein
Xenolphthalein merged commit 43eb59c into overpressure:main Nov 24, 2026
22 checks passed
@PigeonOuyang

Copy link
Copy Markdown
Contributor Author

Thanks @PigeonOuyang, the before/after image makes the problem obvious, and checking the face in Steam's own CEF ( for a text node) is exactly the right proof.NotoSansCJKsc-Regular``zh-cn

I checked what SteamOS does here: Holo's ships no fontconfig rules at all, so there's no stock rule to follow, and a rule of our own is the way. Yours tests the same families Steam's stack falls back to (, then the generic ones), and the file's checksum in the recipe matches.noto-fonts-cjk``Noto Sans

One thing I changed on your branch (d22dffa): the project's own packages take the date of their change as , so is now rather than .pkgver``pico4-base``2026.11.24-1``2026.11.23-2

I've started CI. Once it's green, this goes in, and a packages release with #38 and #39 follows, pinned in phoenix.

@Xenolphthalein Thanks for checking this and correcting the package version. I've added 4f79863 on top of your commit, keeping pico4-base at 2026.11.24-1.

The update adds weak CJK/Arabic fallbacks for mixed-language content, such as a Chinese game title in an English UI whose element still has lang=en. I reproduced this on the PICO 4 in Steam's own CEF: before the update, the test page used Japanese Han forms and Arabic Nastaliq; afterward it used SC forms and Noto Sans Arabic, while the English row remained unchanged.

The language-specific preferences remain in place (zh-tw → TC, ja → JP, ko → KR), and an explicit ur rule preserves Nastaliq. The other sampled scripts also rendered without boxes. For shared Han characters without a matching language tag, SC is the chosen fallback; this does not detect whether an untagged title is Chinese, Japanese or Korean.

I've updated the PR description with the mixed-content before/after screenshots and the broader script sample, all embedded in the description. The diff still contains only the fontconfig file and its PKGBUILD changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants