feat(ui): bundle Noto Sans JP locally + UI font picker with system fonts#364
Merged
appergb merged 1 commit intoOpen-Less:betafrom May 8, 2026
Merged
Conversation
- Bundles @fontsource/noto-sans-jp and @fontsource/inter via npm so we don't need to relax CSP to allow Google Fonts CDN. - New src/lib/fontFamily.ts with localStorage-backed preset stacks (auto / notoSansJp / yuGothic / meiryo / hiragino / custom) and querySystemFonts() via the Web Local Font Access API. - tokens.css exposes --ol-font-sans-active so the runtime override can swap the body font without a CSS rebuild. - Adds a "UI font" row to PersonalizeSection in SettingsModal: select with presets, "Load all fonts" button (one-shot user-gesture-gated permission prompt), free-form custom name, error reporting. - Default cascade in tokens.css now puts Noto Sans JP before any CJK fallback, so Japanese hosts no longer get rendered with Microsoft YaHei (zh-Hans glyph variants). Also adds a "Quiet mode" toggle in the same section: when on, the capsule suppresses transient labels (translating / processing / "N characters inserted" / cancelled). Errors stay visible. quietMode.ts holds the small localStorage helper + 'ol:quiet-mode-changed' event. Note: i18n strings here include keys for follow-up PRs (translation toggle, custom polish styles, per-app overrides). They are scoped to the new sections in those PRs and are no-ops on this branch alone.
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
katanumahotori
pushed a commit
to katanumahotori/openless
that referenced
this pull request
May 8, 2026
Capsule.tsx's quiet-mode gating depends on src/lib/quietMode.ts which is otherwise added in Open-Less#364. Including the file here keeps this PR buildable in isolation. The file is identical to Open-Less#364's; if both PRs land, the second merge is a no-op.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
User description
Why
OpenLess on a Japanese (or any non-zh) host renders the UI with Microsoft YaHei because the font stack falls through to a generic CJK family that Windows resolves to a zh-Hans face. Glyphs are technically correct but visibly off (variant kanji forms, narrower kana). Users want either Noto Sans JP shipped with the app or to point the UI at their installed Yu Gothic / Meiryo / Hiragino / arbitrary font.
Also, the existing capsule overlay shows transient labels (translating / processing / 'N characters inserted' / cancelled) that distract during dictation. Some users just want errors.
What
@fontsource/noto-sans-jpand@fontsource/intervia npm so we don't need to relax CSP to allow Google Fonts CDN.src/lib/fontFamily.tswith localStorage-backed preset stacks (auto/notoSansJp/yuGothic/meiryo/hiragino/custom) andquerySystemFonts()via the Web Local Font Access API.tokens.cssexposes--ol-font-sans-activeso the runtime override can swap the body font without a CSS rebuild.tokens.cssnow puts Noto Sans JP before any CJK fallback, so Japanese hosts no longer get rendered with Microsoft YaHei.quietMode.tsholds the small localStorage helper +ol:quiet-mode-changedevent.Note
The i18n diffs in this PR include keys that are only consumed by follow-up PRs (#TBD translation toggle, custom polish styles, per-app overrides). They are no-ops on this branch alone but kept together to avoid 5 follow-up i18n-only conflicts. PRs that do consume those keys will be filed against this branch's keys; if PR ordering shifts, those PRs will rebase i18n.
PR Type
Bug fix, Enhancement
Description
Bundle local Inter and Noto Sans JP
Add selectable UI font presets
Add quiet mode toggle
Diagram Walkthrough
File Walkthrough
1 files
Add font source dependencies9 files
Import bundled fonts and initializerPersist and apply selectable font stacksPersist quiet mode preference flagAdd UI font and quiet controlsAdd English labels for new settingsAdd Japanese labels for new settingsAdd Korean labels for new settingsAdd Simplified Chinese labels for new settingsAdd Traditional Chinese labels for new settings1 files
Prioritize bundled Japanese font cascade