From b93c915fab8044baa411bb9829435b7c66d46db5 Mon Sep 17 00:00:00 2001 From: Hermes Agent Date: Fri, 25 Sep 2026 17:04:57 -0500 Subject: [PATCH] fix(desktop): gate composer CJK fonts on UI language PingFang/YaHei are installed on every Mac/Windows machine, so a CJK-first stack restyled Latin composer text for all users. Scope the stacks to :lang(zh|zh-hant|ja), which the i18n provider stamps on . Co-authored-by: Cursor --- apps/desktop/src/styles.css | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/apps/desktop/src/styles.css b/apps/desktop/src/styles.css index af59d31e56..26fec9ffee 100644 --- a/apps/desktop/src/styles.css +++ b/apps/desktop/src/styles.css @@ -1676,9 +1676,21 @@ body.guest-pointer-lock :is(webview, iframe) { [data-slot='composer-rich-input'] { unicode-bidi: plaintext; text-align: start; - /* CJK fonts handle full-width punctuation (,。?!…—) before Latin fallback */ - font-family: "PingFang SC", "PingFang TC", "PingFang HK", "Microsoft YaHei", - "Noto Sans CJK SC", "Noto Sans CJK TC", var(--dt-font-sans); +} + +/* Keyed on the UI language, not installed fonts: PingFang/YaHei ship on every + Mac/Windows box and would restyle Latin text for everyone. CJK-first is what + makes shared codepoints (…—“”) render full-width. */ +[data-slot='composer-rich-input']:lang(zh) { + font-family: 'PingFang SC', 'Microsoft YaHei', 'Noto Sans CJK SC', var(--dt-font-sans); +} + +[data-slot='composer-rich-input']:lang(zh-hant) { + font-family: 'PingFang TC', 'Microsoft JhengHei', 'Noto Sans CJK TC', var(--dt-font-sans); +} + +[data-slot='composer-rich-input']:lang(ja) { + font-family: 'Hiragino Sans', 'Yu Gothic UI', 'Noto Sans CJK JP', var(--dt-font-sans); } /* Appearance → Text direction. An explicit RTL/LTR choice stamps dir on the