Repository navigation
Conversation
zh-TW verificationYou asked for native speakers to check Rendering is correct — Host: Arch, Omarchy 4.0.3-1, The problem it fixes is realOn stock quattro the Noto Sans CJK TC is installed the entire time and simply never selected. I rendered The five variants each produce a distinct rendering with a distinct checksum, so the selection is Confirmed correct for What works
The marker machinery itself is sound. The two sections really do survive each other, in both orders. 1.
|
Correction to my review aboveTwo things in my comment are wrong, both in the "the problem it fixes is real" section. The rest of the review stands. One of the corrections sharpens the case for this PR and also bounds it, so it is worth more than the errata. 1.
|
| KR vs TC | 骨 | 直 | 令 | 次 | 內 | 說 | 產 | 雪 | 過 |
|---|---|---|---|---|---|---|---|---|---|
| differing px | 955 | 2194 | 2266 | 1101 | 0 | 1113 | 1488 | 1313 | 716 |
So 內 discriminates SC only. 產, 雪 and 過 are all usable replacements for a KR-vs-TC argument — measurements above.
2. My method line is wrong, and reproducing it as written produces a null
I wrote that I rendered through the sans-serif alias "with pango-view --language=zh-tw". That is not what the script did: it set LANG=zh_TW.UTF-8 LC_ALL=zh_TW.UTF-8 in the environment on a box where that locale had never been generated, so no language reached the shaper at all. The numbers remain valid for the state I meant to test — a stock install is precisely a box with no CJK locale — but the flag as written inverts the result, and anyone re-running it will conclude the feature does nothing:
$ for f in JP KR SC TC HK; do pango-view -q --language=zh-tw \
--font="Noto Sans CJK $f 40" --text="骨直令次內說" -o /tmp/pv.png 2>/dev/null; \
md5sum /tmp/pv.png; done
fcff50719717c054f71f138e9a00a27d ← JP
fcff50719717c054f71f138e9a00a27d ← KR all five faces
fcff50719717c054f71f138e9a00a27d ← SC byte-identical
fcff50719717c054f71f138e9a00a27d ← TC
fcff50719717c054f71f138e9a00a27d ← HK
$ # identical loop, no --language
b11719068241be129b44035fdac3e254 ← JP
c78e2d8d73e7c06b821af5e33f74993f ← KR
a3b90004fbc8e943b06cd08f0c6625dc ← SC
fcff50719717c054f71f138e9a00a27d ← TC note: equals the --language=zh-tw hash
d6221b9d0b550875503f45c5d7d40e1e ← HK
That is HarfBuzz's locl feature. Given a language of zh-TW, all five faces produce byte-identical Traditional Chinese output, and that output is exactly what the TC face produces with no language at all — the face stops mattering. Use hb-shape glyph ids as ground truth rather than pango PNG checksums; pango's bytes also move when only the primary font's metrics change, which is a second way to get a false positive out of that method.
The part worth your attention
Read together, those two make a stronger case for this PR than my original review did, and they also bound it.
Today the fix is load-bearing, and locl is why. Nothing in the repo generates a locale — grep -rn 'locale-gen\|localedef\|locale\.gen' . returns zero hits; the only locale reference anywhere is default/bash/envs sourcing /etc/locale.conf. So a Taiwanese user has no zh_TW.UTF-8 to select, no application can request zh-TW, locl never fires, and the Korean forms carried by the KR face are what they actually see. Your variant preference is the only lever that exists.
But the lever's value is conditional on exactly that. With the locale present versus absent, same face, same text:
$ env LANG=zh_TW.UTF-8 LOCPATH=$HOME/.local/locale \
pango-view -q --font="Noto Sans CJK KR 40" --text="骨直令次內說" ...
→ byte-identical to the TC face
$ env LANG=zh_TW.UTF-8 # locale absent, silently falls back
pango-view -q --font="Noto Sans CJK KR 40" --text="骨直令次內說" ...
→ Korean forms
For any surface that honours the session locale, the correct fix is the locale and the fontconfig preference is redundant. For surfaces that do not, the preference is the only fix. I have not measured which of Quickshell/Qt, Chromium and foot fall on which side, so I am not going to assert it — but it decides whether cjk set is a permanent setting or a bridge until locale selection (#10949) lands, and that is cheaper to settle before this merges than after. My issue 4 above is the same finding from the other end: auto cannot resolve on a stock install because the locale it detects does not exist.
Everything else in the review is unaffected and re-verified where relevant: ~/.config/fontconfig/conf.d/ is read, the prepend → append fix, the unchecked exit status, and the zh_MO / zh_HK notes.
|
Thanks for the thorough verification. Addressed in
|
Re-ran against
|
| pattern | baseline, no preference | cjk set tc |
|---|---|---|
sans-serif |
Noto Sans CJK KR (pos 7) | Noto Sans CJK TC (pos 2) |
serif |
Noto Serif CJK KR (pos 6) | Noto Serif CJK TC (pos 3) |
monospace |
Noto Sans Mono CJK KR (pos 6) | Noto Sans Mono CJK TC (pos 3) |
:charset=4e00:lang=zh-tw |
Noto Sans CJK JP (pos 1) | Noto Sans CJK TC (pos 1) |
| head of those three chains | Liberation Sans / Liberation Serif / CaskaydiaMono | all three unchanged |
All five variants, all three generics, and the restore:
state sans-serif serif monospace
set jp Noto Sans CJK JP Noto Serif CJK JP Noto Sans Mono CJK JP
set kr Noto Sans CJK KR Noto Serif CJK KR Noto Sans Mono CJK KR
set sc Noto Sans CJK SC Noto Serif CJK SC Noto Sans Mono CJK SC
set tc Noto Sans CJK TC Noto Serif CJK TC Noto Sans Mono CJK TC
set hk Noto Sans CJK HK Noto Serif CJK HK Noto Sans Mono CJK HK
unset Noto Sans CJK KR Noto Serif CJK KR Noto Sans Mono CJK KR (baseline, exactly)
Sans, serif and mono all work, every variant is reachable, unset is clean, and row 4 of the table is the Chromium bare-charset path still earning the appended lang rule its keep (TC where baseline gives JP).
Issue 2 specifically. The row that was broken was the default state, no ~/.config/fontconfig/fonts.conf at all, which is what any user who has never run omarchy font set has. The shell's own query is fc-match -f '%{family[0]}' monospace at shell/Commons/Style.qml:469:
monospace resolves to
no cjk preference JetBrainsMono Nerd Font (spacing=100)
cjk set tc, no fonts.conf JetBrainsMono Nerd Font (spacing=100) ← was Noto Sans CJK TC, proportional
cjk set jp, no fonts.conf JetBrainsMono Nerd Font (spacing=100)
cjk set tc, LANG=zh_TW.UTF-8 JetBrainsMono Nerd Font (spacing=100)
Both orders are fine too (font set then cjk set, and cjk set then font set), which now follows structurally from the two commands owning separate files instead of racing inside one. The order dependence I complained about is gone.
The one behaviour change, and why I think it needs no code
The three family rules carry no lang test, so with tc selected, explicitly tagged Japanese, Korean and Simplified text also resolves to the TC face:
sans-serif:lang=ja baseline Noto Sans CJK KR → cjk set tc Noto Sans CJK TC
sans-serif:lang=ko baseline Noto Sans CJK KR → cjk set tc Noto Sans CJK TC
sans-serif:lang=zh-cn baseline Noto Sans CJK KR → cjk set tc Noto Sans CJK TC
monospace:lang=ja baseline Noto Sans Mono CJK KR → cjk set tc Noto Sans Mono CJK TC
I went into this expecting to hand you a patch. Then I measured what the face choice is worth once a language tag is present, and the answer is nothing:
$ TTC=/usr/share/fonts/noto-cjk/NotoSansCJK-Regular.ttc
$ for i in 0 1 2 3 4; do hb-shape --font-file=$TTC --face-index=$i --language=ja \
--no-clusters --no-positions --text=骨直令次說產; done
[gid45132|gid27873|gid9808|gid22495|gid37887|gid27042] ← JP face
[gid45132|gid27873|gid9808|gid22495|gid37887|gid27042] ← KR face
[gid45132|gid27873|gid9808|gid22495|gid37887|gid27042] ← SC face
[gid45132|gid27873|gid9808|gid22495|gid37887|gid27042] ← TC face
[gid45132|gid27873|gid9808|gid22495|gid37887|gid27042] ← HK face
All five faces produce identical Japanese forms, and the same holds for --language=ko, zh-TW and zh-CN. This is locl again, the same mechanism as in my earlier correction. A surface that put lang=ja on the fontconfig pattern is a surface that hands the language to the shaper as well (Pango does both), so it gets JP forms out of the TC face. Baseline's KR face was equally not-Japanese and equally corrected by locl, so this is one wrong-on-paper face traded for another with no rendered difference.
My recommendation is therefore to leave it as pushed. For completeness, what I tried and what it would cost:
- Nine lang-tested rules (ja/ko/zh-cn × sans/serif/mono) placed after the existing block is a no-op. Both rules prepend relative to the same matched
sans-serifelement, so the unconditional TC stays in front of the language's own face. I measured that before I understood it. - The same nine rules placed before the block do work:
lang=ja→ JP,lang=ko→ KR,lang=zh-cn→ SC,lang=zh-twandlang=zh-hk→ TC, untagged → TC, Latin heads unchanged, charset path unchanged,xmllintclean, zero fontconfig warnings underFC_DEBUG. - But they move territory-less
lang=zhfrom the user's TC to SC, becausecompare="contains"treats a bare tag as contained by a territory-qualified one. That is defensible by CLDR likely-subtags, and it is what I argued for inresolve_auto, but it is not what someone who typedcjk set tcasked for.
Nine rules plus a new edge case, to fix something locl already fixes. Not worth it. The honest bound on that conclusion: it holds because Noto CJK is a single .ttc with locl coverage across all five faces, so an application that tags the fontconfig pattern but not the shaper run would still show the chosen variant's forms. I could not find one to name, and if you know of one this trade flips.
Two small things
omarchy-font-cjk-current:16derives the variant from the<!-- omarchy-cjk-variant: -->comment. Delete that one line by hand andcurrentreportsunsetwhile the rules stay live and keep working. Now that the file is owned outright, reading the family out of the sans rule instead (sed -n 's/.*Noto Sans CJK \([A-Z]*\).*/\1/p', lowercased) is a source of truth that cannot drift from what fontconfig reads.unsetis unaffected, it tests-f.cjk set TCexits 1 withUnknown variant: TC. The usage block only advertises lowercase, so this is defensible; avariant="${variant,,}"before the validatingcaseis the one-line version if you want it.
And a note so nobody re-raises it from the diff view: git diff quattro <pr-head> -- bin/omarchy-font-set does show changes, but that is quattro moving underneath the branch in 4cb9c75a ("Move Kitty defaults into the system config"). Against the merge base f99d33a8 the file is untouched, so your claim holds.
pgrep output is silenced, zh_MO → tc, and the usage block now says both of the things it needed to.
|
Both small things addressed in
|
|
Thank you for this. The work is carried forward in #15508, which brings the still-missing parts of Japanese, Chinese and Korean setup together into one change, so I am closing this in its favour. The This was checked against |
* Accept Qt 6.12's qml6 window class in the input method acceptance test Qt 6.12 names qml6 windows org.qt-project.qml6, so the Qt case timed out on the first engine and the run never reached Hangul, Pinyin or Chewing. Co-Authored-By: Z8 <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * Take the input bus name from a stray fcitx5 instead of restart-looping A fcitx5 started outside the unit (a user autostart, a hand-run fcitx5 -d) owns org.fcitx.Fcitx5, so the unit's instance exits on arrival and Restart=always loops every two seconds while the unsupervised one serves input. --replace makes the unit's instance take the name, and the stray exits. A stray started after the unit still finds the name taken and exits without disturbing it. Refs #7461. Co-Authored-By: Claude Opus 5.5 <[email protected]> * Name keycode bindings by what the leading layout prints on the key The resize shortcuts are bound to the two keys right of 0 by keycode, which is right for every layout, but the keybindings menu named those keys by compiling a US keymap, so a JIS user read Super + = where their key prints ^, and Super + Shift + = (vertical resize) looked like the horizontal one. The menu now compiles the leading layout and variant, the one Hyprland resolves bindings against, so JIS reads - and ^ and Dvorak reads [ and ]. Fixes #10452. Co-Authored-By: Claude Opus 5.5 <[email protected]> * Keep Hangul and Zhuyin keys on their standard positions under any Latin layout Two-set Hangul and Zhuyin are positional: every Korean and Taiwanese keyboard prints the jamo and bopomofo on QWERTY positions, and Windows and macOS keep them there whatever Latin layout is active. Fcitx gave each new engine an empty layout override, so it followed the group layout, and a Dvorak, Colemak, AZERTY or QWERTZ user who added Hangul or Chewing typed jamo and bopomofo in the wrong places. Positional presets now carry a `us` layout, which the engine gets when the group leads with another Latin arrangement, at seeding, during migration alignment, and from the picker. Korean and JIS groups keep no override, since their layouts already put those keys there and carry the 한/영 and 半角/全角 keys the engine needs to switch back. Changing the leading layout re-decides only an override Omarchy set, so a user's own choice stays. Pinyin and Mozc spell by letter and get none. Co-Authored-By: Claude Opus 5.5 <[email protected]> * Offer Cangjie for Hong Kong, with Hong Kong character forms Hong Kong types Cangjie, not Zhuyin, and the only Traditional Chinese choice was Chewing with Taiwan's TC glyphs, so a Hong Kong user had neither their input method nor their character forms; the HK mapping #15116 added was unreachable from any preset. `omarchy setup input cangjie5` now installs fcitx5-table-extra and adds its Cangjie5 engine with the HK font fallback. The `cangjie` table in fcitx5-chinese-addons is the Simplified variant and ships disabled, so it is not the engine Hong Kong expects. Like Hangul and Zhuyin, Cangjie's radicals sit on QWERTY positions, so the preset carries the same `us` layout override. There is no installer row: installer engines live in the base package set so offline first boot can configure them, and fcitx5-table-extra is 43 MB. Co-Authored-By: Claude Opus 5.5 <[email protected]> * Offer Korean with Right Alt as 한/영 and Right Ctrl as 한자 Many Korean laptops, and keyboards in 101/104-key compatible mode, send Right Alt and Right Ctrl from their 한/영 and 한자 keys. The Korean row's plain `kr` layout only maps the dedicated Hangul keycodes, so on those keyboards 한/영 did nothing and Super+I was the only way into Hangul. XKB's `kr(kr104)` maps Right Alt to Hangul and Right Ctrl to Hangul_Hanja, so a second row carries it as the desktop override `kr:kr104`, a layout and variant the keyboard defaults and the Fcitx seeding now split apart. Right Alt then sends Hangul rather than Alt_R, so the dictation push-to-talk binding, which matches the Alt_R keysym, cannot take the 한/영 key. The ISO's input-selection validation has to accept `kr:kr104` before an ISO carrying this row is built. Co-Authored-By: MoerAI <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * Let people choose CJK glyph forms, and bring them with a CJK language Han characters are drawn differently in Japanese, Korean, Simplified and Traditional Chinese, and an English desktop with no input method gets whichever variant fontconfig happens to rank first (Korean in GTK and terminals, Japanese in Chromium). The first input method seeds a preference, but nothing could change or clear it afterwards, and Hong Kong forms were unreachable. `omarchy font cjk [jp|kr|sc|tc|hk|default]` and Style > Font > Chinese, Japanese, Korean rewrite the one preference file the input method already seeds, through configure.py's writer, so its alias-accept shape still reaches Chromium's family-less fallback (by naming the Latin families 50-omarchy.conf substitutes) and never displaces the Latin font. Being weak, it governs untagged text only: tagged text and a CJK session LANG keep their own forms. Choosing Japanese, Korean or Chinese under Setup > Language now also adds Mozc, Hangul, Pinyin or Chewing when the Fcitx group has no composition engine yet, and seeds the glyph forms once. Without a reachable Fcitx the switch still succeeds and names where to add the engine. The submenu is widened like Style > Font so the check after the longest rows is not truncated away, and omarchy-font-cjk joins the guard readers since six rows read it. Design from #9969 by Yasuhiro Usutani, with the conf.d placement, append-not-prepend and Chromium fallback findings from linyiru's review there. Co-Authored-By: Yasuhiro Usutani <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * Theme the Fcitx candidate window with the current Omarchy theme The candidate window kept fcitx5's stock light-grey popup whatever the theme. A template renders its palette with the rest of the theme, and omarchy-theme-set-fcitx5 copies it into an fcitx5 theme directory beside links to the packaged glyphs. It then reloads classicui only when Fcitx is already running, so a theme switch never starts it. Selecting the theme in classicui.conf is a one-time step, run by setup and the migration. Theme switches skip it because headless setup does not run the retint list, and because a choice of fcitx5's own theme made later has to stick. It writes through a dotfiles symlink. It treats default and default-dark as unclaimed, since configtool writes them on any classicui save. Highlighted preedit text uses the background colour on the accent, as the candidate does, so it stays readable. Co-Authored-By: AkitaOnRails <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * Type Japanese, Chinese and Korean into the menu search The search line was a Text fed by Keys.onPressed, and Qt hands input-method text only to an item that answers inputMethodQuery, so fcitx5 never even engaged in the menu: typing with Mozc, Hangul, Pinyin or Chewing selected put raw romaji in the line. It is now FilterInput, a TextInput that forwards every key to the menu's handler first and types only what that leaves alone, so preedit renders in place and commits reach the filter. FilterInput swallows Alt and Super chords, which the old accumulator never typed, and keeps the caret hidden at the end, because the menu owns Left and Right. While the uninstall confirmation is open the line is read-only: a commit arrives as an input-method event, not a key, so swallowing keys alone let composed text land behind the dialog. Fixes #11682. Co-Authored-By: linyiru <[email protected]> Co-Authored-By: TAE58 <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * Default untagged Han to Japanese forms With no CJK language, input method or chosen forms, Arch's 65-nonlatin puts Noto Sans CJK KR first, so GTK, terminals and Qt drew Han in Korean forms while Chromium and Ghostty drew Japanese, and Omarchy's own shell could mix the two inside one Japanese string. Chromium's per-character fallback also sorted Noto Sans Mongolian ahead of every CJK face for a run of CJK punctuation on an English page, changing the line height. Accepting Noto CJK JP after Omarchy's Latin families makes every app agree on the forms Chromium already showed, and fixes the punctuation. It is an alias accept in the system file, so a user's preference file, loaded later in 50-user, inserts ahead of it, and a CJK LANG or language tag still decides as before. Only CJK characters change face; Latin, symbols, emoji and Nerd Font glyphs resolve as they did. Co-Authored-By: Claude Opus 5.5 <[email protected]> * Keep an explicit return to the system's CJK forms Choosing Default deleted the preference file, which is also what "never chosen" looks like, so the next CJK language or input method seeded over it: pick Default, switch to Korean and back, and Han was Korean again. Default now writes a preference with no forms in it, which seeding treats as taken. The Chromium fallback assertions read the replica's output through process substitution, so a crash before any output left an empty array and a loop that asserted nothing. The helper now fails the test when the replica fails or answers fewer queries than it was asked. The manual says how someone who added Hangul or Chewing under Dvorak before the positional override can move its keys: Omarchy does not remap an engine they already type with. Co-Authored-By: Codex Medium <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * Offer Hong Kong at install, and name Hong Kong and Taiwan for themselves Hong Kong now has an installer choice: Hong Kong (Cangjie) seeds Cangjie5 with Hong Kong character forms during offline first-boot setup, so fcitx5-table-extra joins the base package set, where installer engines have to be. Existing installs are not sent the 43 MB package; `omarchy setup input cangjie5` installs it on demand as before. The Traditional Chinese installer row becomes Taiwan (Zhuyin), the input method labels read Taiwan (Zhuyin) and Hong Kong (Cangjie), and the glyph-forms menu offers Taiwan and Hong Kong, each named for itself rather than under any country. Co-Authored-By: Claude Opus 5.5 <[email protected]> * Give Korean one install choice, with Right Alt as 한/영 kr104 is the plain Korean layout plus Right Alt as 한/영 and Right Ctrl as 한자, so dedicated keys keep working and keyboards that send Right Alt and Right Ctrl for those keys gain them. That covers both kinds of keyboard, so a second row asked Korean users a question they could only answer wrong. Korean now installs kr104; Right Alt and Right Ctrl stop being plain modifiers there, and dictation push-to-talk stays on F9. Plain `kr`, which earlier installs saved, is still accepted and left alone. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Omarchybot <[email protected]> Co-authored-by: Z8 <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]> Co-authored-by: MoerAI <[email protected]> Co-authored-by: Yasuhiro Usutani <[email protected]> Co-authored-by: David Heinemeier Hansson <[email protected]> Co-authored-by: AkitaOnRails <[email protected]> Co-authored-by: linyiru <[email protected]> Co-authored-by: TAE58 <[email protected]> Co-authored-by: Codex Medium <[email protected]>
Fixes #9580.
CJK characters always resolve to the Korean variant (Noto Sans CJK KR) regardless of the user's locale, because the sans-serif chain in the system
65-nonlatin.confonly lists KR and Omarchy has no locale-aware selection.What this adds (post-install only)
omarchy font cjk list— installed CJK variants (jp/kr/sc/tc/hk)omarchy font cjk set <variant|auto>— writes~/.config/fontconfig/conf.d/50-omarchy-cjk.conf, owned outright by this command; the user'sfonts.confis left alone by constructionomarchy font cjk current— shows the active variant (unsetwhen the file is absent)omarchy font cjk unset— removes the file (rm -f)automaps LANG (ja→jp, ko→kr, zh_CN/SG→sc, zh_TW/HK/MO→tc);en_*and unknown locales prompt instead of guessing.zh_HKmaps totcby design, sohkis reachable only by naming it explicitly. A stock install only generatesC.UTF-8anden_US.UTF-8, soautoalways prompts there until additional locales existomarchy font setis untouched by this PR (no shared file, no cooperation needed)cjk-variantsproviderprependrules cover sans-serif/serif/monospace plus alangrule for the Chromium per-character path that ignoreslang. Thelangrule usesmode="append"so a monospace query never gets a proportional CJK face at the head of its chain; charset matching still outranks family matching, so the bare-charset path keeps workingDesign notes
autoonly proposes from LANG on first run; later LANG changes do not move the selection.komapping keeps KR (status quo), so Korean users see no behavior change.conf.dloads beforefonts.conf, so theprepend_firstmonospace ruleomarchy font setwrites keeps winning the head of the chain.Verification (author)
cjk-set jp/krflipsfc-match -sCJK ordercjk-current/cjk-listjp, all 5 variants)autoonLANG=en_US.UTF-8promptsmenu-test,menu-guards-test,./test/cliRevision
a71d175(review feedback, sandboxHOME+fc-liststub):set tc→current tc,langrulemode="append", XML parsesunset→ file removed,current unsetautoonzh_MO→tc,zh_HK→tc,bogus→ exit 1fonts.confnever created or modified./test/cliNot verified by author
ko, zh_CN, zh_TW rendering — requesting native speakers to test. ko mapping is unchanged from status quo, so Korean users see no behavior change. (zh_TW verified by reviewer
linyiru; re-verification of theappendrevision requested.)Out of scope
fontconfigpackage (65-nonlatin.confis intentionally locale-agnostic upstream)User-config side effects
Only
~/.config/fontconfig/conf.d/50-omarchy-cjk.confis written.~/.config/fontconfig/fonts.confis untouched bycjk-set.Terminal configs (
foot.inietc.) are untouched bycjk-set.Per-application tuning (e.g. Foot's fallback font sizes in
foot.ini)