dsh-fonttune 0.1.3 → 0.1.5

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/CHANGELOG.en.md CHANGED
@@ -2,6 +2,26 @@
2
2
 
3
3
  All notable changes to **dsh-fonttune** are documented here. Chinese version: [CHANGELOG.md](CHANGELOG.md).
4
4
 
5
+ ## [0.1.5] - 2026-09-15
6
+
7
+ ### Added
8
+ - **Code font weight**: weight is split into **two independent axes** — "Body font weight" for text and interface copy (headings included), and "Code font weight" for code blocks, inline code, tool code bodies and terminal output only. The single slider used to press on both chains, so moving body always dragged code with it; now each moves on its own. The field is `weightCode` (300–600, 0 = leave alone), sitting next to the existing `weight`, whose meaning narrows to "body and interface text".
9
+
10
+ ### Changed
11
+ - **Card layout**: the weight sliders moved into the group they belong to — body font → body size offset → body weight → code font → code size offset → code weight — and the two are labelled separately ("Body font weight" / "Code font weight"). The card description now reads "Body and code fonts, a size and a weight for each, and a West/CJK split".
12
+ - **Code no longer follows the body weight**: weight has no token chain to ride (measured on rc.2 — **zero** `font-weight: var(--dsw-font-…)` usages; the theme writes literal weights in its own class rules), which is why the body axis is a blanket `body, body *` `!important` rule. The code axis now appends a scoped rule **after** it that wins either on specificity (`[class*=…]`) or on source order (`pre` ties with `body *`); the selector covers `pre` / `code` / `kbd` / `samp` / `var` / `tt` / `textarea` / `.cm-editor` **and their descendants** (the blanket rule matches every element, so a highlighted `<span>` inside a `<pre>` has to be named too), plus `[class*="code" i]` and `[class*="terminal" i]` for the tool code bodies and the terminal, which are plain `div`s. **The rule is written even when the code weight is unset** (value `normal`), otherwise the blanket rule would pull code onto the body weight; after upgrading, body-weight behaviour is unchanged and code returns to DSH's own weight.
13
+ - **Compatibility table** now lists 0.1.5 as the latest version.
14
+
15
+ ## [0.1.4] - 2026-09-15
16
+
17
+ ### Added
18
+ - **Code font-size offset**: the size control is split into **two independent axes** — "Body font size offset" for text and interface sizes, and "Code font size offset" for code blocks and inline code only. The single slider used to scale both chains, so moving the body always dragged code along with it; now each moves on its own. The field is `sizeOffsetCode` (-3 ~ +6 px, 0 = leave alone), sitting next to the existing `sizeOffset`, whose meaning narrows to "body and interface text". After upgrading, an existing configuration leaves code at DSH's own sizes while body behaviour is unchanged.
19
+
20
+ ### Changed
21
+ - **Card layout**: each size slider now sits under the font it resizes — body font → body size offset → code font → code size offset → weight. The two sliders are labelled separately ("Body font size offset" / "Code font size offset"), and the card description reads "Body and code fonts, a size offset for each, weight, and a West/CJK split".
22
+ - **How the code chain is consumed**: DSH's markdown code tokens are `font` shorthands (`--dsw-font-markdown-code` / `-code-block` / `-code-block-small`, valued like `11px/19px <family>`), and the shorthands — not their `-font-size` parts — are what the shipped stylesheets actually read, so the code axis rewrites those too (size and line height scaled, family list kept verbatim) alongside the split parts. The embedded fallback map is corrected to rc.2's real values (it claimed 13px/20px) and gains the three shorthand names.
23
+ - **Compatibility table** now lists 0.1.4 as the latest version.
24
+
5
25
  ## [0.1.3] - 2026-09-14
6
26
 
7
27
  ### Changed
package/CHANGELOG.md CHANGED
@@ -2,6 +2,26 @@
2
2
 
3
3
  **dsh-fonttune** 的重要变更都记录在这里。英文版见 [CHANGELOG.en.md](CHANGELOG.en.md)。
4
4
 
5
+ ## [0.1.5] - 2026-09-15
6
+
7
+ ### 新增
8
+ - **代码字重**:字重从「一个全局偏移」拆成**两个互不影响的轴**——「正文字重」覆盖正文与界面文字(含标题),「代码字重」只覆盖代码块、行内代码、工具代码块与终端输出。原来那一个滑块同时压两条链路,调正文必然带动代码;现在各调各的。字段为 `weightCode`(300~600,0 = 不动),与既有的 `weight` 并列;`weight` 语义收敛为「正文与界面文字」。
9
+
10
+ ### 变更
11
+ - **卡片布局**:字重滑块同样移进对应字体那一组——正文字体 → 正文字号偏移 → 正文字重 → 代码字体 → 代码字号偏移 → 代码字重;两处文案分开(「正文字重」/「代码字重」),卡片描述改为「正文与代码字体、各自的字号与字重、中西文分栏」。
12
+ - **代码轴不再被正文字重带着走**:字重没有可依附的 token 链(rc.2 实测**零处** `font-weight: var(--dsw-font-…)`——主题是在自己的类规则里写字面量),所以正文轴一直是 `body, body *` 的全量 `!important` 规则。代码轴现在在这条规则**之后**追加一条作用域规则,靠更高特异性(`[class*=…]`)或更靠后的同特异性(`pre` 与 `body *` 同分)取胜;选择器覆盖 `pre` / `code` / `kbd` / `samp` / `var` / `tt` / `textarea` / `.cm-editor` **及其后代**(全量规则命中每一个元素,所以 `<pre>` 里高亮用的 `<span>` 也必须点名),再加 `[class*="code" i]` 与 `[class*="terminal" i]` 覆盖工具代码块与终端这类没有语义标签的纯 `div`。**代码字重未设置时也会写这条规则**(值 `normal`),否则全量规则会把代码一起拽到正文字重上;旧配置升级后正文字重行为不变、代码回到 DSH 原值。
13
+ - **兼容表**改列 0.1.5 为最新版本。
14
+
15
+ ## [0.1.4] - 2026-09-15
16
+
17
+ ### 新增
18
+ - **代码字号偏移**:字号从「一个全局偏移」拆成**两个互不影响的轴**——「正文字号偏移」作用于正文与界面文字,「代码字号偏移」只作用于代码块与行内代码。原来那一个滑块同时缩放两条链路,调正文必然带动代码;现在各调各的。字段为 `sizeOffsetCode`(-3 ~ +6 px,0 = 不动),与既有的 `sizeOffset` 并列;`sizeOffset` 语义收敛为「正文与界面文字」,旧配置升级后代码字号回到 DSH 原值、正文行为不变。
19
+
20
+ ### 变更
21
+ - **卡片布局**:字号滑块移到对应字体下面——正文字体 → 正文字号偏移 → 代码字体 → 代码字号偏移 → 字重;两处滑块文案分开(「正文字号偏移」/「代码字号偏移」),卡片描述改为「正文与代码字体、各自的字号偏移、字重、中西文分栏」。
22
+ - **代码链路的消费点**:DSH 的 markdown 代码 token 都是 `font` 简写(`--dsw-font-markdown-code` / `-code-block` / `-code-block-small`,值是 `11px/19px <family>` 这种形式),真正被样式表消费的是简写而不是 `-font-size` 分件,所以代码轴连同简写一起重写(尺寸与行高按比例乘、字体族原样保留),分件也一并覆盖;内置兜底表按 rc.2 的真实取值修正(此前记的 13px/20px 与主题不符),并补上三个简写名。
23
+ - **兼容表**改列 0.1.4 为最新版本。
24
+
5
25
  ## [0.1.3] - 2026-09-14
6
26
 
7
27
  ### 变更
package/README.en.md CHANGED
@@ -2,13 +2,15 @@
2
2
 
3
3
  > [中文](README.md) | **English**
4
4
 
5
- **Font plugin for DeepSeek Harness (DSH)**: set the body and code font families, a global font-size offset and a global font weight, and pick fonts per **Western / CJK** slot. Everything lives in the native card under **Settings → Plugins → Plugin configuration** and applies immediately.
5
+ **Font plugin for DeepSeek Harness (DSH)**: set the body and code font families, a font size and a font weight for each, and pick fonts per **Western / CJK** slot. Everything lives in the native card under **Settings → Plugins → Plugin configuration** and applies immediately.
6
6
 
7
7
  ## Features
8
8
 
9
9
  - **Body / code fonts** — two independent fallback lists, Latin families first and CJK after; leaving one empty keeps DSH's own stack untouched
10
- - **Global font-size offset** — -3 ~ +6 px, stacked on top of DSH's own font-size setting rather than replacing it; every size step scales together with its line height
11
- - **Global font weight** — any integer from 300 to 600; unset or 400 both mean "keep DSH's own weight"
10
+ - **Body font-size offset** — -3 ~ +6 px for text and interface sizes, stacked on top of DSH's own font-size setting rather than replacing it; every size step scales together with its line height
11
+ - **Code font-size offset** — -3 ~ +6 px for code blocks and inline code, **independent** of the body offset: moving one never moves the other
12
+ - **Body font weight** — any integer from 300 to 600, overriding the weight of text and interface copy including headings; unset or 400 keeps DSH's own weight
13
+ - **Code font weight** — any integer from 300 to 600 for code blocks, inline code and terminal output only; unset or 400 keeps DSH's own weight and keeps code out of the body weight
12
14
  - **West / CJK split (simple mode)** — a switch at the top of the card: simple mode gives just a Western and a CJK single-pick slot (one pair for body, one for code), advanced mode is the full stack editor; both views share one stack, so toggling never changes the order you set up
13
15
  - **Font picker panel** — four preset groups (monospace / CJK / Latin / generic), plus an "installed on this machine" group on Chromium; a name that is not in the list can be created with "use xxx"
14
16
  - **Drag to reorder** — selected families are a chip list you can drag, with earlier / later buttons kept for keyboard and touch
@@ -18,7 +20,7 @@
18
20
 
19
21
  | Plugin version | Supported DSH versions |
20
22
  | --- | --- |
21
- | **0.1.3** (latest) | 0.1.5-rc.2 |
23
+ | **0.1.5** (latest) | 0.1.5-rc.2 |
22
24
 
23
25
  `engines.dsh` requires **0.1.5-rc.2** or newer, and the compatibility declaration lists only the **latest release of the 0.1.5 line**: it carries every fix in that line, which makes it the most stable build of the major version, while older builds of the same major version stay compatible per semantic versioning. Earlier or newer DSH versions are untested and not declared. On install or update, the DSH market runs a host-compatibility preflight against `engines.dsh`, `dsh.compatibility.dshReleases` and `peerDependencies` in `package.json`.
24
26
 
@@ -48,7 +50,7 @@ Restart DSH once afterwards and open the Web UI; changing settings needs no rest
48
50
 
49
51
  - **Open the settings** — Settings → Plugins → Plugin configuration → expand the "Font tune" card
50
52
  - **Pick fonts** — in simple mode click the four slots (Body · Western, Body · CJK, Code · Western, Code · CJK); in advanced mode use "Add font" and the chip editor to maintain the full fallback list
51
- - **Tune numbers** — drag the size-offset / weight sliders; the value applies on release. Changed fields are marked and can be reset individually, with "Reset all" at the bottom of the card
53
+ - **Tune sizes and weights** — each slider sits under the thing it changes: body font → body size offset → body weight → code font → code size offset → code weight. Drag and release to apply. Changed fields are marked and can be reset individually, with "Reset all" at the bottom of the card
52
54
  - **Preview** — the mixed-script and code preview at the bottom of the card renders with the current configuration
53
55
  - Settings are stored in DSH's settings document (`settings.yaml`), so they travel with your configuration
54
56
 
package/README.md CHANGED
@@ -2,13 +2,15 @@
2
2
 
3
3
  > [English](README.en.md) | **中文**
4
4
 
5
- **DeepSeek Harness(DSH)字体插件**:设置正文与代码的字体族、全局字号偏移与字重,并按「西文 / 中文」分栏挑字体;配置入口是 **设置 → 插件 → 插件配置** 里的原生卡片,改完即时生效。
5
+ **DeepSeek Harness(DSH)字体插件**:设置正文与代码的字体族、各自独立的字号与字重,并按「西文 / 中文」分栏挑字体;配置入口是 **设置 → 插件 → 插件配置** 里的原生卡片,改完即时生效。
6
6
 
7
7
  ## 功能
8
8
 
9
9
  - **正文 / 代码字体** —— 两套独立的字体回退列表,拉丁字体在前、中文字体在后;留空表示完全沿用 DSH 的字体栈
10
- - **全局字号偏移** —— -3 ~ +6 px,与 DSH 自己的「字号大小」叠加而不是覆盖;每一档字号连同它的行高一起等比缩放
11
- - **全局字重** —— 300 ~ 600 任意整数;未设置或 400 都表示沿用 DSH 原本的字重
10
+ - **正文字号偏移** —— -3 ~ +6 px,作用于正文与界面文字;与 DSH 自己的「字号大小」叠加而不是覆盖,每一档字号连同它的行高一起等比缩放
11
+ - **代码字号偏移** —— -3 ~ +6 px,**独立**作用于代码块与行内代码:调正文不会带动代码,调代码也不会带动正文
12
+ - **正文字重** —— 300 ~ 600 任意整数,覆盖正文与界面文字的粗细(含标题);未设置或 400 表示沿用 DSH 原本的字重
13
+ - **代码字重** —— 300 ~ 600 任意整数,只覆盖代码块、行内代码与终端输出;未设置或 400 表示代码保持 DSH 原样,也就是**不被正文字重带着走**
12
14
  - **西文 / 中文分栏(简单模式)** —— 卡片顶部一个开关:简单模式只给「西文」「中文」两个单选格(正文/代码各一对),高级模式是完整的字体栈编辑器;两种模式共用同一条栈,来回切换不会改动已排好的顺序
13
15
  - **选字体面板** —— 内置 等宽 / 中文(CJK)/ 拉丁 / 通用 四组预设,Chromium 下再补上「本机已安装」分组;搜索不到的名字可以直接「使用 xxx」新建
14
16
  - **拖拽排序** —— 已选字体是 chip 列表,可拖动调整回退顺序,同时保留前移 / 后移按钮(键盘与触屏可用)
@@ -18,7 +20,7 @@
18
20
 
19
21
  | 插件版本 | 支持的 DSH 版本 |
20
22
  | --- | --- |
21
- | **0.1.3**(最新) | 0.1.5-rc.2 |
23
+ | **0.1.5**(最新) | 0.1.5-rc.2 |
22
24
 
23
25
  `engines.dsh` 下限为 **0.1.5-rc.2**,兼容声明只列 **0.1.5 线的最新版本**:它包含这条线的全部修复,是同一大版本里最稳的一版,而同一大版本内的旧版本按语义化版本约定向上兼容。更早或更新的 DSH 未经验证,不作声明。安装或更新时,DSH 市场会依据 `package.json` 里的 `engines.dsh`、`dsh.compatibility.dshReleases` 与 `peerDependencies` 做宿主兼容预检。
24
26
 
@@ -48,7 +50,7 @@ dsh plugin --profile web add <插件目录路径>
48
50
 
49
51
  - **打开设置** —— 设置 → 插件 → 插件配置 → 展开「字体增强」卡片
50
52
  - **换字体** —— 简单模式下点「正文 · 西文字体」「正文 · 中文字体」「代码 · 西文字体」「代码 · 中文字体」四个格子选字体;高级模式下用「添加字体」与 chips 编辑器维护完整回退列表
51
- - **调整数值** —— 拖字号偏移 / 字重滑块,松手即生效;改过的字段标「已修改」并可单独重置,卡片底部有「全部重置」
53
+ - **调整字号与字重** —— 滑块就在它作用的对象下面:正文字体 → 正文字号偏移 → 正文字重 → 代码字体 → 代码字号偏移 → 代码字重。拖动松手即生效;改过的字段标「已修改」并可单独重置,卡片底部有「全部重置」
52
54
  - **预览** —— 卡片底部的中英混排与代码预览用当前配置渲染
53
55
  - 设置保存在 DSH 的设置文档里(`settings.yaml`),跟随配置走
54
56