본문으로 건너뛰기
L

dsh-font-enhancer

loyalchiiina/dsh-font-enhancer

DSH UI 글꼴과 색상을 직접 꾸밉니다: 영역별 스타일링, 통합 오버라이드, 테마 저장과 전환, 무작위 글꼴과 색상.

설치

dsh plugin --profile web add github:loyalchiiina/dsh-font-enhancer

README

dsh-font-enhancer

按区域分别设置 DSH 界面字体、字号、颜色,支持统一控制、主题保存/切换、随机配色/字体。

DSH 的界面长什么样,你说了算。

You decide what DSH looks like.

npm license dsh

A DSH (DeepSeek Harness) plugin that lets you style the UI per-region — each region (sidebar, message area, input box, code block, etc.) gets its own Chinese/English font, font-size, line-height, weight, italic, and text color. Features unified global font/color overrides, theme save/switch, 框选 (pick-region) element selection, and random font/color generators.

字体区域设置面板

右侧「字体区域设置」面板:选择主题 / 保存方案、全局统一(颜色 / 字体 / 字号 / 字重 / 斜体)、框选区域、随机字体 / 随机颜色、刷新,以及按区域展开的独立属性(英文字体 Times New Roman、中文字体 楷体、字号 15、行距 1.6、字重 400 + 文字颜色)。 The per-region panel: theme picker and save, unified colour/font/size/weight/italic, pick-region, random font/colour, plus per-region attributes.

为什么值得装 / Why it's worth it — 觉得默认字号太小?中文字体不好看?想给整个界面统一换字体就开「全局统一」,想给某个角落单独上色就点「框选区域」在页面上直接框元素(不用记 CSS 选择器)。配色纠结就点「随机配色」生成一套,喜欢就存成主题随时切回来。

Default font too small? Chinese typeface not to your taste? Flip on Unified for one font everywhere, or hit Pick Region and drag a box right on the live page to style one corner — no CSS selectors needed. Can't decide on colours? Random Color generates a palette; save the ones you like as themes.

v1.3.0 同时支持 DSH 网页端(浏览器访问 Web GUI)和 桌面端(Electron 内置窗口)。 新增一键下载安装可爱字体(霞鹜文楷/得意黑/站酷快乐体等,带实时下载进度)、添加自提供安装包🔄 刷新按钮、保存方案记住统一状态等功能。搜「字体」即可在插件市场找到本插件。

✅ v1.3.0 supports both the DSH Web GUI (browser) and the Desktop Electron window. New: one-click install of cute fonts (LXGW WenKai / Smiley Sans / ZCOOL KuaiLe etc. with live download progress), add your own font file, refresh button, themes remember unified overrides. Search "font / 字体" on the plugin market to find it.


功能总览 · At a glance(中英对照 / Bilingual)

区域样式 · Per-region styling

中文English
15 个预校准区域:左侧栏、Logo、新建会话、任务板、工作区名、设置、消息区、会话标题、输入区、Tabs、轮次指示、Agent/模型名、右侧扩展面板、代码块、底部展开条15 pre-calibrated regions: sidebar, logo, new-session, taskboard, workspace name, settings, messages, session title, composer, tabs, turn indicator, agent/model name, right panel, code blocks, bottom bar
每区域独立设置:中文字体、英文字体、字号、行距、字重(100–900 滑块)、斜体、文字颜色(取色器)Per-region controls: Chinese/English font, size, line-height, weight (100–900 slider), italic, text colour (picker)
勾选区域复选框展开该区域设置面板Tick a region's checkbox to expand its settings panel

全局统一与框选 · Unified & pick-region

中文English
「统一颜色」:一个取色器应用到所有启用区域Unified Colour: one picker applies to all enabled regions
「统一字体」:一种字体+字号应用到所有启用区域Unified Font: one family + size applies to all enabled regions
「框选区域」:在实时页面上拖框直接选中元素,无需记 CSS 选择器Pick Region: drag a box on the live page to style elements — no CSS selectors needed

主题系统 · Theme system

中文English
保存整套配置为命名主题Save the full configuration as a named theme
应用 / 重命名 / 删除主题Apply, rename and delete themes
主题跨 DSH 重启与插件版本升级保留Themes survive restarts and plugin version bumps

随机生成与字体 · Random & fonts

中文English
🎲 随机字体(中/英)与 🎨 随机配色(黄金角高区分度配色)🎲 random fonts and 🎨 vivid high-distinction colours (golden-angle stepping)
一键下载安装可爱字体(霞鹜文楷 / 得意黑 / 站酷快乐体等,带实时进度)One-click install of cute fonts (LXGW WenKai / Smiley Sans / ZCOOL KuaiLe etc.) with live progress
添加自提供安装包:选择本地字体文件自动校验并安装Add your own font file: pick a local file, auto-verified and installed
字体列表与 Microsoft Word 一致(Times New Roman、楷体、宋体、微软雅黑…)Font lists mirror Microsoft Word (Times New Roman, KaiTi, SimSun, Microsoft YaHei…)

三球共享皮肤 · Shared ball skins

中文English
与 dsh-todo-float-ball / dsh-skill-browser 共享同一套 128 款皮肤目录(window.__DSH_BALL_SKINSShares the same 128-skin catalogue with dsh-todo-float-ball / dsh-skill-browser (window.__DSH_BALL_SKINS)
任一处切换,三个悬浮球与其面板颜色实时同步Switching anywhere syncs all three balls and their panels in real time
「原版(仅本球)」选项可让字体球单独回到原始暖极光外观"Original (this ball only)" keeps the font ball's warm-aurora look

平台与持久化 · Platforms & persistence

中文English
网页端(浏览器访问 Web GUI)与桌面端(Electron 内置窗口)双端可用Works on both the Web GUI (browser) and Desktop (Electron)
全部设置存 localStorage,刷新与重启后保留All settings persist in localStorage, survive refresh and restart
纯客户端插件,无宿主服务、无外部依赖、无构建步骤Pure client-side plugin: no host services, no external deps, no build step

功能 Features

区域样式 Per-region Styling

  • Pre-calibrated regions covering the DSH Web GUI UI: Left sidebar, Logo, New Session, Taskboard entry, Workspace name, Settings, Conversation messages, Session title, Composer/input, Tabs, Turn indicator, Agent/model name, Right extension panel, Code blocks, Bottom expand bar.
  • Per-region controls: Chinese font, English font, font-size, line-height, font-weight (100–900 slider), italic toggle, text color with color picker.
  • Each region has a checkbox — tick it to expand the settings panel for that region.

全局统一 Unified Controls

  • Unified Color checkbox: one color picker applies to all enabled regions.
  • Unified Font checkbox: one font family + size applies to all enabled regions.
  • When unified is ON, the randomizer randomizes the unified value (not per-region).

🎨 三球共享 128 皮肤 Unified Ball Skins

  • 与 dsh-todo-float-ball / dsh-skill-browser 共享同一套 128 款皮肤目录(window.__DSH_BALL_SKINS)。
  • 面板 🎨 按钮或 DSH 设置页任一处切换,三个悬浮球与其展开面板颜色实时同步。
  • 「原版(仅本球)」选项可让字体球单独回到原始暖极光外观,不影响另两球。

主题系统 Theme System

  • Save the current full configuration (all regions' fonts + colors) as a named theme.
  • Apply any saved theme to restore its settings.
  • Rename themes via the inline input + ✏ button.
  • Delete unwanted themes.
  • Themes survive DSH restarts and plugin version bumps.

随机生成 Random Generation

  • 🎲 Random Font — randomize Chinese + English font for all (or one) enabled regions.
  • 🎨 Random Color — randomize vivid, high-distinction colors (golden-angle stepping).
  • Per-region 🎲/🎨 buttons on each card head for single-region random.

面板 UI Panel UI

  • Floating Aa button (bottom-right, draggable like a pet).
  • Left-right layout in card head: checkbox + color dot + name on the left, 🎲font/🎨color/⟳reset/✕delete buttons on the right.
  • Card body splits into two columns: fonts on the left, size/weight/italic/color on the right.
  • Toast notifications (no window.alert) for all save/apply/delete operations.
  • Reload the plugin by collapsing the floating button (hide → rebuild).

其他

  • Font lists mirror Microsoft Word (Times New Roman, Arial, Calibri, 楷体, 宋体, 微软雅黑…).
  • Default: English = Times New Roman, Chinese = 楷体 (KaiTi).
  • All settings persist in localStorage; survive page refresh and DSH restart.
  • Panel font is fixed to KaiTi (楷体) so it never changes with the plugin's own rules.

安装 Install

# From the DSH profile directory:
dsh plugin --profile desktop add ./dsh-font-enhancer

Or copy the folder into node_modules/ and add the package name to the profile bundles list, then restart DSH.

Requirements

  • DSH Desktop 2.0+ (tested on 0.1.0-rc.6).
  • 本版本仅验证 DSH 网页端(浏览器访问 Web GUI);桌面端窗口适配见顶部 ⚠️ 说明。

版本 Versions

版本说明
v1.3.0最新:网页端+桌面端双端可用。一键下载安装可爱字体(带进度)、添加自提供安装包、刷新按钮、保存方案记住统一状态、字重斜体。搜「字体」可找到。
v1.0.0旧版:内置区域样式 + 统一控制 + 主题。

用法 Usage

  1. Click the floating Aa button (bottom-right).
  2. Tick a region's checkbox → the settings panel expands below.
  3. Adjust Chinese/English font, size, line-height, weight, italic, and color.
  4. Use 统一颜色 / 统一字体 to apply a single setting to all regions.
  5. Save your configuration as a theme (type a name, click 💾存).
  6. Switch themes anytime via the dropdown + 应用 button.
  7. Use 🎲 随机字体 / 🎨 随机颜色 for quick experimentation.

插件卡顿 Plugin stuck?

  • Click the DSH "重载" (Reload) button, or
  • Click the Aa floating button to collapse it — this triggers a full plugin rebuild.

快速上手 Quick start

想给所有消息区域换一种字体/颜色?

  1. 点右下角 Aa 按钮打开面板。
  2. 全局统一 区勾选 统一字体 → 选中文/英文字体 → 所有区域立即统一。
  3. 勾选 统一颜色 → 点色块选色 → 所有区域统一变色。

想单独设置 输入框 的字号?

  1. 打开面板 → 找到「输入区」卡片 → 勾选它的复选框(展开设置)。
  2. 右侧列改 字号 / 字重,左侧列改中/英文字体。

想存一套配色以后换着用?

  1. 调好各区域字体、颜色。
  2. 在顶部输入框填名字 → 点 💾存
  3. 之后随时在下拉框选中 → 点 应用 切换。

原理 How it works

Pure client-side plugin. lib/client.js is a __ModuleLoader__ bundle that:

  1. Injects a <style> tag with CSS rules per enabled region.
  2. Renders a floating control panel (vanilla JS, no framework).
  3. Uses localStorage for persistence with a SCHEMA_VERSION sentinel.
  4. lib/index.js is a minimal Cordis module so the bundle loads at all.

No host services, no external dependencies, no build step.


常见问题 FAQ

插件卡住了 / 样式不生效?

  • 点击 DSH 左下角 重载 按钮。
  • 或点击右下角 Aa 悬浮球使其折叠——折叠时会自动重建插件(删除旧注入样式并重新初始化)。

区域颜色互相串色 / 某区域颜色不对?

  • 检查该区域是否被更靠前的区域(如 body 兜底区域)覆盖。
  • 15 个预校准区域的顺序已按层叠优先级排列,但如果你自定义了区域,注意后列出的规则会覆盖前面的(同特异性)。
  • 各区域的具体 CSS 选择器可在卡片中查看和编辑。

统一颜色/字体勾选了,但随机后没变化?

  • 统一开关 开启 时,随机按钮直接改变统一值(统一颜色/字体本身),而不是改变各区域。这是正常行为——关掉统一开关后随机才会分别改各区域。

主题保存后找不到?

  • 保存成功会有 toast 提示"已保存:xxx"。主题在下拉框中,选中后点击 应用 即可切换。
  • 主题保存在 localStorage,升级插件版本也不会丢失。

面板字体怎么是楷体,和界面字体不一样?

  • 面板字体固定为楷体(KaiTi),这是有意为之——防止插件自身的 CSS 规则覆盖面板 UI,确保面板始终可读。

文件结构 File structure

dsh-font-enhancer/
├── package.json        # Plugin manifest with dsh.bundle + dsh.client
├── cordis.patch.yml    # Cordis patch: registers the bundle
├── lib/
│   ├── index.js        # Host half (minimal Cordis module)
│   └── client.js       # Client bundle (all UI + logic, ~1000 lines)
├── README.md           # This file
├── LICENSE             # MIT
└── .gitignore

支持 Support

发现 bug 或有功能建议?欢迎在 GitHub Issues 提 issue。

Found a bug or have an idea? Open an issue at GitHub Issues.


License

MIT

관련 플러그인