dsh-Fonts
已验证 · 实测可装 zhijun-dai
功能简介
Developer 类别的 DeepSeek Harness 插件。
可用 — 实测通过,早期项目
Developer 类别的 DeepSeek Harness 插件。 实测能干净安装、正常启动。早期项目,但功能可用。
「已验证」表示我们的自动化 CI 在干净 profile 里实际执行了 dsh plugin add 并启动成功——仅此而已。功能描述与版本兼容性均为作者声明。这不是安全审计,也不代表对第三方代码的背书。
README
简介
DeepSeek Harness 的 Web UI 默认使用系统字体栈,没有任何内置 webfont。dsh-Fonts 把字体变成可组合的资源:
- 内置预设:JetBrains Mono + Inter、Fira Code + IBM Plex Sans、Cascadia Code 三套 OFL 授权字体搭配,随插件包离线分发(无需联网、无 CORS 问题)
- 自定义导入:在设置面板里填入字体名 + woff2 链接,即可导入你自己的界面/代码字体,选择持久化在本机
- 插件 API:提供
ctx.fonts注册表服务,其他插件可以用ctx.get("fonts")注册或消费字体预设
预览
设置 → 常规 → 字体(点击展开截图)

JetBrains Mono + Inter 应用效果

使用
本插件为 DeepSeek Harness 的双面插件(host 半边分发字体文件,浏览器半边提供注册表与设置行),安装后即可在 设置 → 通用 → 字体 中切换。
安装方式:
# GitHub
dsh plugin --profile web add github:zhijun-dai/dsh-Fonts
# 本地目录(profile 目录是 pnpm workspace 根,必须加 -w)
dsh plugin --profile web add -w /path/to/dsh-Fonts
# npm
dsh plugin --profile web add dsh-fonts
然后重启 dsh web。
切换字体: 设置 → 通用 → 字体行,点击预设卡片实时应用;选择"默认"恢复系统字体栈。
导入自定义字体: 在字体行的编辑区(界面字体 / 代码字体)填写三项后点"添加":
| 字段 | 说明 |
|---|---|
| 字体名 | 任意名称,用于在字体栈中引用(如 Inter) |
| woff2 链接 | 字体文件的 http(s) 直链,要求允许跨域访问(CDN 一般都可以) |
| 字重 | 400 常规 · 500 中等 · 600 半粗 · 700 粗体,选与文件实际粗细一致的字重。下载页面通常会标注:Regular=400、Bold=700。选错不会报错,只是界面里的加粗效果会变成浏览器模拟的"假粗体" |
例子——从 Fontsource CDN 导入 Inter 常规字重作为界面字体:
字体名:Inter
woff2 链接:https://cdn.jsdelivr.net/npm/@fontsource/[email protected]/files/inter-latin-400-normal.woff2
字重:400 常规
点"添加"后立即应用,刷新页面后仍生效;同一字体名 + 同一字重重复添加会覆盖旧条目,点"移除"删除。
插件 API
其他插件通过 ctx.get("fonts") 懒加载消费字体服务(跨插件的 require 是构建错误,不能用模块导入):
// 你的插件浏览器半边
import type { FontPreset, FontRegistry } from 'dsh-fonts/client'
// 注册一套自己的字体预设
const dispose = ctx.get('fonts')?.register({
id: 'my-preset',
ui: ['My Font', '-apple-system', 'sans-serif'],
code: ['My Mono', 'monospace'],
faces: [{ family: 'My Font', weight: '400', src: ['https://example.com/my-font.woff2'] }],
})
// 订阅快照
const off = ctx.get('fonts')?.subscribe((snapshot) => {
console.log(snapshot.activeId, snapshot.revision)
})
完整的 FontPreset / FontSnapshot / FontRegistry 类型见 lib/types/client/index.d.ts。
工作原理
- 浏览器半边在
apply时通过ctx.provide("fonts", registry)把字体注册表挂到根上下文 - 选择变更时重写注入的
<style id="dsh-fonts">:@font-face规则 +:root上的--dsw-font-family/--ds-font-family-code覆盖——这两个 CSS 变量是 DSH UI 的字体入口(@deepseek-ai/dsh-client-ui-theme的base.css定义,全部组件经var()消费) - host 半边通过
ctx.webServer注册/plugins/dsh-fonts/fonts/*路由,分发data/fonts/里随包打包的 woff2 - 选择持久化在
localStorage(dsh-fonts:prefs),启动时恢复;插件注册的预设被选中后若该插件缺席,回退到默认
已知限制
- 部分组件硬编码了
Inter, var(--dsw-font-family)优先栈(如工作区浏览器),这些位置装了 Inter 的系统上仍显示 Inter - 捆绑字体为 latin 子集(体积 ~280KB);中文按字体栈尾部回退到系统字体(PingFang SC / Microsoft YaHei)
- 自定义导入仅支持 woff2 直链(http/https)
字体致谢
捆绑字体均以 SIL Open Font License 1.1 授权,许可证文本随包分发于 data/fonts/LICENSE-*.txt:
- JetBrains Mono — JetBrains s.r.o.
- Inter — Rasmus Andersson
- Fira Code — The Fira Code Project Authors
- IBM Plex Sans — IBM Corp.
- Cascadia Code — Microsoft
💝 致谢
- DeepSeek Harness — 插件化架构与
dsh.client双面插件机制 - Fontsource — webfont 分发
- dsh-Catppuccin / dsh-Solarized — 本插件参照的仓库结构
dsh-Fonts · Copyright 2026-present zhijun-dai · MIT License
安装
装一次目录插件,之后本站所有插件都能让 DeepSeek Harness 自动找、自动装:
dsh plugin add dshbase-catalog 然后对 agent 说「帮我装 dsh-Fonts」,它会在目录里找到并自动安装。文档:dshbase-catalog · 已验证场景包。
该插件是 GitHub 源码(未发 npm)——直接从仓库装:
Web profile:
dsh plugin --profile web add github:zhijun-dai/dsh-Fonts Headless(CLI)profile:
dsh plugin --profile headless add github:zhijun-dai/dsh-Fonts 实测报告
验证通过:从 GitHub 源码完成 L1 安装 + L2 加载 + L3 运行(dsh 0.1.0-rc.6)。