Introduction¶
DSH’s philosophy is “everything is a plugin,” but there was no native interface for adjusting the text display of the client interface itself—body font, code font, zoom level, line height. In Chinese environments, encountering font fallback often meant having to manually modify styles.
dsh-ui-font turned this into a plugin: after installation, centralized adjustments for the entire interface’s text display can be made in Settings → Fonts. Changes are previewed in real-time, settings are stored in browser localStorage, and persist after refresh. Below is an introduction to its features, installation methods, and notes.
What is this¶
dsh-ui-font is a DSH client plugin, maintained by linshufan21, open source under the MIT license. In one sentence: it modifies the text display effects of the entire DSH interface, covering body font, code font, display scale, line height, font smoothing, code ligatures, and provides a font browser with Chinese glyph markers.
Core Features¶
Fonts and Typography¶
- Body Font: Presets (Microsoft YaHei / PingFang SC / DIN Alternate / Noto Sans CJK SC / Noto Sans SC / Noto Serif SC / Lxgw WenKai / HarmonyOS Sans / MiSans), or custom font stack
- Code Font: Presets (Cascadia Code / Consolas / JetBrains Mono / Fira Code / Noto Sans Mono SC / Maple Mono / Maple Mono NF), or custom
- Display Scale: 80–130% scaling (
zoom), default 100% means no change - Chat Area Line Height: 1.3–2.0
- Font Smoothing: Anti-aliasing toggle
- Code Ligatures:
font-variant-ligatures
Font Browser and Chinese Glyph Markers¶
When customizing fonts, you can open the font browser sub-window to display all locally installed fonts in a list. Each item is previewed with its own glyphs; click to apply. It automatically falls back to a common font list if enumeration fails.
Fonts without Chinese glyphs will carry an “English” badge; a prompt is given when selected to avoid Chinese display fallback.
Interaction Details¶
- Application Feedback: The apply button displays “Applied ✓ / Invalid Input / ⚠ No Chinese Glyphs,” instead of silently failing
- Input Font Follow Toggle: Disabled by default (to prevent cursor misalignment during IME composition). When enabled, the input box uses the body font
- Real-time Preview + Restore Defaults
Scope and Persistence¶
- Full Markdown coverage: Agent replies, titles, lists, tables, links, etc. all follow the body font; code blocks remain monospaced
- Settings Persistence: Settings are stored in browser
localStorage(keydsh-ui-font:*), persisting after refresh
Installation and Enablement¶
Using DSH’s built-in plugin command, install directly from GitHub:
dsh plugin add github:linshufan21/dsh-ui-font
Then edit the profile’s package.json (path %USERPROFILE%\.dsh\profiles\web\package.json) and append "dsh-ui-font" to dsh.profile.bundles. Restart DSH (close and reopen windows), and the “Fonts” page will appear in Settings.
Note: If a Git-hosted plugin contains build scripts, pnpm blocks prepare by default. You need to whitelist the corresponding package in allowBuilds in the profile’s pnpm-workspace.yaml. This plugin has no build scripts, so this step is not needed.
Local Development and Synchronization¶
If you want to modify code locally, place the repository in any directory and install via file path:
cd $env:USERPROFILE\.dsh\profiles\web
pnpm add "file:E:\deepseekwork1\dsh-ui-font"
Then append "dsh-ui-font" to dsh.profile.bundles in package.json and restart DSH.
After modifying lib/client.js, run the sync script to copy the files to the installed copy and verify:
powershell -ExecutionPolicy Bypass -File E:\deepseekwork1\_工具脚本\sync-dsh-ui-font.ps1
Then press Ctrl+F5 in the DSH window to force refresh. The bundle rev is calculated dynamically, so you don’t need to restart the backend.
Structurally, lib/client.js handles browser-side settings registration and style injection, lib/index.js is a host-side stub implementation (purely client-side plugin), and cordis.patch.yml serves as a bundle patch to register the plugin into the loader. The settings category ID is dsh-ui-font, and the slot is settings.dshUiFont.item.
If you want to develop on top of it, note the conventions with DSH rc.6: exports.inject should only declare ["slots", "locale"], do not declare runtime — rc.6 no longer has this cordis service, and declaring it will cause the interface to hang in pending.
Uninstall¶
cd $env:USERPROFILE\.dsh\profiles\web
pnpm remove dsh-ui-font
Then manually remove "dsh-ui-font" from the bundles in package.json.
Use Cases and Notes¶
It is suitable for users who want to unify body and code fonts in DSH, adjust display scale for high or low resolution screens, or control chat area line height. In environments with obvious Chinese font fallback, it can also be used to directly select a font with Chinese glyphs.
Pay attention to a few points before use:
- The plugin runs with the current DSH process permissions. It is recommended to read the source code and license (MIT, allows free use, modification, distribution, including commercial use, requires retaining copyright notice) before installing.
- “Input Font Follow” is disabled by default. When enabled, cursor misalignment may occur during Chinese IME composition (before Pinyin is confirmed) due to Chromium kernel restrictions. Keeping it disabled by default avoids this; body text display is not affected.
zoomis only applied when not 100%, not injected by default, and does not affect the default state.- Code area selectors rely on hash class names (
_codeBlock, etc.) and may become invalid after a major DSH version upgrade. In this case, body text styles still take effect. - Font enumeration prioritizes the browser Local Font Access API. When the host denies permission, it falls back to probing the built-in common font list. Newly installed fonts may not appear; you can manually enter the font name.
- Custom font stacks have anti-injection filtering: rejects
; { } ( ) < >, max length 300.
Conclusion¶
dsh-ui-font puts interface font adjustments into a single settings page: presets cover common Chinese, Western, and monospaced fonts, changes are previewed in real-time, can be restored to default, and settings are retained with the browser. If you are not satisfied with DSH’s default display effects, it is a low-cost option for changes.
- Plugin Directory Page (Community directory, no official affiliation with DeepSeek or Hongfang): https://www.skillhub.cn/plugins/linshufan21/dsh-ui-font
- GitHub Repository: https://github.com/linshufan21/dsh-ui-font