Repository navigation
fix(pico4-base): the Noto face of each language, and a CJK/Arabic fallback for mixed-language content - #39
Conversation
…guage, and Noto Sans Arabic for Arabic
…as the project's own packages are versioned
|
Thanks @PigeonOuyang, the before/after image makes the problem obvious, and checking the face in Steam's own CEF ( I checked what SteamOS does here: Holo's One thing I changed on your branch (d22dffa): the project's own packages take the date of their change as I've started CI. Once it's green, this goes in, and a packages release with #38 and #39 follows, pinned in phoenix. |
…bic faces after the Latin families
Xenolphthalein
left a comment
There was a problem hiding this comment.
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 Thanks for checking this and correcting the package version. I've added 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 The language-specific preferences remain in place ( 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 |
Problem
After #38, CJK text is no longer tofu, but the faces are still wrong:
characters such as 骨直具者每海角内化令今冷低画界茶步 render with Japanese forms.
Arabic text is slanted/stacked.
The
currentblock is what fontconfig picks today: Noto Sans CJK JP for the Han characters andNoto Nastaliq Urdu for the Arabic. The
preferredblock is what the new rules select: Noto SansCJK SC and Noto Sans Arabic.
Cause
The Steam UI sets
<html lang="zh-cn">(Chinese),"ko"(Korean) or"ar"(Arabic); fontconfig'sgeneric 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
phoenix/pico4-base/67-pico4-language-fonts.conf, installed to/etc/fonts/conf.d/.zh-cn-> Noto Sans CJK SC;zh-tw-> TC;zh-hk-> HK;ja-> JP;ko-> KR, forsans-serif,Noto Sans,serifandmonospace;ar-> Noto Sans Arabicfor
sans-serifandNoto Sans.Noto Sans CJK SCandNoto Sans Arabicweakly after theLatin families; an
urrule keeps Noto Nastaliq Urdu.pico4-base2026.11.24; the file is insource,sha256sumsandbackup.Verification (PICO 4)
fc-matchbefore/after:sans-serif:lang=zh-cn: Noto Sans CJK JP -> Noto Sans CJK SCserif:lang=zh-cn: -> Noto Serif CJK SCmonospace:lang=zh-cn: -> Noto Sans Mono CJK SCzh-tw-> TC;ja-> JP;ko-> KR;ar-> Noto Sans Arabic;ur-> Noto Nastaliq Urdulang=enkeeps Noto Sans as the primary familydocument.documentElement.langzh-cn/ko; a Chinese textnode's platform font is Noto Sans CJK SC (
NotoSansCJKsc-Regular).lang="en": the English row keeps the Latin family; the Chinese title andthe 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 haslang=en. The config appendsNoto Sans CJK SCandNoto Sans Arabicas weak fallbacks afterthe 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
urrule keeps Nastaliq.Before: a mixed page under
lang="en"(Chinese in the JP face, Arabic in Nastaliq).After: the same page with the fallback.
Every Steam UI script under
lang="en": Thai, Hebrew, Hindi, Greek, Russian, Vietnamese andemoji render with the Noto fonts already in the image.
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-cjkpackage from #38; Arabic uses the existingnoto-fonts.Size
A few KB; no image size impact.