@klarkxy/dsh-font 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,38 +1,33 @@
1
- # @klarkxy/dsh-font
1
+ # Font
2
2
 
3
3
  <!-- release-state-note -->
4
4
 
5
- Font: customize the **interface font**, **code font**, and **conversation font size** of the DeepSeek Harness Web GUI from one settings panel.
5
+ [简体中文](docs/README.zh-CN.md)
6
6
 
7
- [中文文档](docs/README.zh-CN.md)
7
+ Change the interface font, code font, and conversation font size of the DeepSeek Harness Web GUI.
8
8
 
9
- ## What it does
10
-
11
- The plugin adds a settings panel to its bundle page in the Plugins view:
12
-
13
- - **Interface font** — the typeface of all interface text. Pick a preset (Microsoft YaHei, PingFang SC, SimSun, KaiTi, Source Han Sans/Serif), pick an actually-installed family via **Load system fonts**, or enter any CSS `font-family` stack. Empty restores the host default.
14
- - **Code font** — the monospace typeface of code blocks, inline code and terminals. Presets include Cascadia, JetBrains Mono, Fira Code, Consolas, Sarasa Mono and Maple Mono; system fonts and custom stacks are accepted too.
15
- - **Conversation font size** — 10–22 px, driven through the official `ctx.theme.setFontSize()` entry. It stays in sync with the native stepper in Settings → General and persists through the host settings scope.
16
-
17
- *Load system fonts* uses the Local Font Access API (`window.queryLocalFonts()`): Chromium-only and gated behind a browser permission prompt. Every click re-enumerates — after the first read the button relabels to *Reload system fonts*, so fonts installed later appear on the next click. Each entry commits the exact family name CSS needs, while the label leads with the name the UI locale recognizes — a converted font shows as `华康少女文字W5(P)(DFPShaoNvW5-GB)` in Chinese and `DFPShaoNvW5-GB(华康少女文字W5(P))` in English. Where the API is unavailable or denied (Firefox, Safari, Electron policy), the panel simply keeps the preset + manual-input flow. No font files are bundled — every choice is rendered with fonts already installed on the machine, falling back through the stack when a family is missing.
9
+ ## Install
18
10
 
19
- Changes apply immediately through owned inline overrides on `<html>` for the host's `:root` font tokens (`--dsw-font-family`, `--ds-font-family-code`). Derived Markdown, brand, and terminal fonts follow them. Choosing *Default* or unloading restores prior inline values without removing another owner's later updates.
11
+ ```sh
12
+ dsh plugin --profile web add @klarkxy/dsh-font
13
+ ```
20
14
 
21
- ## Where settings live
15
+ Replace `web` with your profile name, then restart the profile or reload the page.
22
16
 
23
- Font choices keep the existing browser `localStorage` key and format. Each browser and machine has its own installed fonts, so this plugin's font choices remain browser-local. Font preferences live in the browser's `localStorage`, so they must be set again after switching browser, domain or port. The font size needs no local copy: the theme service persists it host-side through `setFontSize(px)`.
17
+ ## Use
24
18
 
25
- The host half is intentionally empty: no Host service, no RPC, no model calls.
19
+ Open **Plugins → Font**:
26
20
 
27
- ## Install
21
+ - **Interface font** and **Code font**: pick a preset, type any font name, or click **Load system fonts** to choose from fonts installed on this computer.
22
+ - **Conversation font size**: 10–22 px, kept in sync with **Settings → General**.
28
23
 
29
- Requires DSH 0.2.0-rc.2 or later:
24
+ Changes apply immediately. Choose **Default** to go back to the DSH font.
30
25
 
31
- ```bash
32
- dsh plugin --profile web add @klarkxy/dsh-font
33
- ```
26
+ ## Limits
34
27
 
35
- Replace `web` with your profile name and restart the profile (or reload the page) after installing. Open **Plugins → Font** to change fonts.
28
+ - **Load system fonts** works only in Chromium-based browsers and asks for permission.
29
+ - Font choices are saved in the current browser; set them again in another browser or address. The font size is saved by DSH.
30
+ - No fonts are bundled; the chosen font must be installed on the computer.
36
31
 
37
32
  ## License
38
33
 
@@ -1,38 +1,33 @@
1
- # @klarkxy/dsh-font
1
+ # 字体
2
2
 
3
3
  <!-- release-state-note -->
4
4
 
5
- 字体:在一个设置面板里自定义 DeepSeek Harness Web GUI 的**界面字体**、**代码字体**和**会话字号**。
6
-
7
5
  [English](../README.md)
8
6
 
9
- ## 功能
10
-
11
- 插件在「插件」页自己的 Bundle 详情页里提供设置面板:
12
-
13
- - **界面字体** —— 整个界面文字的字体。可选预设(微软雅黑、苹方、宋体、楷体、思源黑体/宋体),也可以点「读取系统字体」从本机已装字体里挑,或输入任意 CSS `font-family` 字体栈。留空恢复宿主默认。
14
- - **代码字体** —— 代码块、行内代码与终端的等宽字体。预设含 Cascadia、JetBrains Mono、Fira Code、Consolas、更纱黑体、Maple Mono,同样支持系统字体与自定义。
15
- - **会话字号** —— 10–22 px,走官方 `ctx.theme.setFontSize()` 入口,与「设置 → 通用」里的字号步进器实时同步,并由宿主设置域持久化。
7
+ 自定义 DeepSeek Harness Web GUI 的界面字体、代码字体和会话字号。
16
8
 
17
- 「读取系统字体」用的是 Local Font Access API(`window.queryLocalFonts()`):仅 Chromium 系可用,首次会弹浏览器权限授权。每次点击都重新枚举——首次读取后按钮变为「重新读取系统字体」,新装字体再点一次即可刷新。列表项写入的始终是 CSS 精确匹配需要的族名,但显示以界面语言为准——同一款转换字体在中文界面显示 `华康少女文字W5(P)(DFPShaoNvW5-GB)`,在英文界面显示 `DFPShaoNvW5-GB(华康少女文字W5(P))`。在不支持或被拒绝的环境(Firefox、Safari、Electron 权限策略)里,面板退回预设 + 手填,不受影响。包内不带任何字体文件——所有选择都靠本机已装字体渲染,缺字体时按栈回退。
9
+ ## 安装
18
10
 
19
- 改动立即生效:字体覆盖写入 `<html>` 上的宿主 `:root` 字体 token(`--dsw-font-family`、`--ds-font-family-code`),Markdown、品牌和终端的派生字体随之更新。选择「默认」或卸载插件时,恢复原来的内联值,并保留其他写入者后来的修改。
11
+ ```sh
12
+ dsh plugin --profile web add @klarkxy/dsh-font
13
+ ```
20
14
 
21
- ## 设置存在哪里
15
+ 把 `web` 换成你的 profile 名,安装后重启 profile 或刷新页面。
22
16
 
23
- 字体选择沿用原有浏览器 `localStorage` 键和格式。每个浏览器、每台机器装的字体不同,所以本插件的字体选择仍留在浏览器本地。字体偏好保存在浏览器 localStorage,更换浏览器、域名或端口后需重新设置。字号不需要本地副本:theme 服务通过 `setFontSize(px)` 将它保存在宿主侧。
17
+ ## 使用
24
18
 
25
- 宿主侧(host half)是刻意留空的:没有 Host service、没有 RPC、不调模型。
19
+ 打开「插件 → 字体」:
26
20
 
27
- ## 安装
21
+ - **界面字体**和**代码字体**:选预设、手动输入字体名,或点「读取系统字体」从本机已装字体中选择。
22
+ - **会话字号**:10–22 px,与「设置 → 通用」中的字号同步。
28
23
 
29
- 需要 DSH 0.2.0-rc.2 或更高版本:
24
+ 改动立即生效。选择「默认」即可恢复 DSH 原字体。
30
25
 
31
- ```bash
32
- dsh plugin --profile web add @klarkxy/dsh-font
33
- ```
26
+ ## 限制
34
27
 
35
- 把 `web` 换成你的 profile 名,安装后重启 profile(或刷新页面),然后打开「插件 → 字体」调整。
28
+ - 「读取系统字体」只在 Chromium 系浏览器可用,首次使用需要授权。
29
+ - 字体选择保存在当前浏览器,换浏览器或访问地址后需重新设置;字号由 DSH 保存。
30
+ - 插件不附带字体文件,所选字体必须已安装在本机。
36
31
 
37
32
  ## 许可证
38
33
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@klarkxy/dsh-font",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Font: customize the interface font, code font, and conversation font size of the DeepSeek Harness Web GUI.",
5
5
  "icon": "./icon.svg",
6
6
  "license": "SEE LICENSE IN LICENSE",
@@ -57,7 +57,7 @@
57
57
  "test": "vitest run --root ../.. --config vitest.editor-plugins.config.ts --maxWorkers=2 plugins/dsh-font/src"
58
58
  },
59
59
  "dependencies": {
60
- "@klarkxy/dsh-plugin-kit": "0.3.1"
60
+ "@klarkxy/dsh-plugin-kit": "0.3.2"
61
61
  },
62
62
  "peerDependencies": {
63
63
  "@deepseek-ai/cordis": ">=4.0.4"
@@ -97,6 +97,6 @@
97
97
  },
98
98
  "homepage": "https://klarkxy.github.io/dsh-plugins/plugins/font/",
99
99
  "dshRelease": {
100
- "contentHash": "fc92c2888357fe8a2e91746e694834c09ef665653e721ff591c42594472ae7f0"
100
+ "contentHash": "a234269ae4dfcbf8c1136ebb571912683af3e258489f654db141e6604fe02a3e"
101
101
  }
102
102
  }