dsh-fonttune 0.3.3 → 0.3.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,25 @@
2
2
 
3
3
  All notable changes to **dsh-fonttune** are documented here. Chinese version: [CHANGELOG.md](CHANGELOG.md).
4
4
 
5
+ ## [0.3.5] - 2026-09-29
6
+
7
+ ### Fixed
8
+ - **A weight offset inside the old absolute-weight range was rewritten on the way back**: such an offset was read as a pre-relative absolute weight and converted again, which is the "the notch jumps to −1" report from 0.3.1 as soon as the range reaches past +200. The document now states which scale its weight fields are on, so a legacy value is converted once and only where that statement is missing.
9
+ - **The highest notch of the weight slider wrote a value the slider itself cannot show**: rounding the top position up passed the ceiling measured for the font. Every position is now a whole number of steps from the neutral one and stays inside the range.
10
+
11
+ ### Changed
12
+ - **The weight slider picks its step so that every notch is a change you can see**: one notch is the smallest jump between the font's own faces that is clearly visible rather than the smallest possible one, so the control may offer fewer positions than before while every one of them shows; body text changes at every position, and bold text and headings stop once they reach their heaviest face.
13
+
14
+ ## [0.3.4] - 2026-09-29
15
+
16
+ ### Fixed
17
+ - **A slider quietly fell back to the document's value when the value never reached the document**: when a write was accepted but the document's value never followed, the slider jumped back after a moment with nothing to show for it. The control now says so underneath, and says the value came from the document.
18
+
19
+ ### Changed
20
+ - **The weight hints name the smallest step**: the step is measured for the current font, and its smallest step is a small change by nature — the hints now say so.
21
+ - **The faux bold and faux italic switches say what they actually do**: turning faux bold off adds at most one extra step for a font that ships no bold face and cannot invent the middle ones; turning both off is the same story.
22
+ - **The follow hint is clearer**: while the interface follows the conversation, the interface section's own font and weight are ignored.
23
+
5
24
  ## [0.3.3] - 2026-09-28
6
25
 
7
26
  ### Changed
@@ -16,7 +35,7 @@ All notable changes to **dsh-fonttune** are documented here. Chinese version: [C
16
35
 
17
36
  ### Fixed
18
37
  - **The upper positions of the weight slider jumped to a lower number**: two of them were read as an absolute weight and converted, so the third step showed as −1 and the fourth rendered exactly like 0. A position now stays where it is put.
19
- - **With the conversation weight at 0, the conversation still picked up the interface offset**: the two axes shared a range, so 0 carried the interface's offset as well and the 0 and +1 positions looked nearly the same. Each axis now keeps to its own scope, and 0 is DSH's own weight.
38
+ - **With the conversation weight at 0, the conversation still picked up the interface offset**: the two axes shared a range, so 0 carried the interface's offset as well and the 0 and +1 positions looked nearly the same. Each axis now keeps to its own scope, and 0 is DSH's own weight.
20
39
  - **The line-height preview in the card was taller at 100% than at the notches above it**: the preview and the conversation did not share a base. They do now, so every notch is taller in the preview as well.
21
40
 
22
41
  ### Changed
package/CHANGELOG.md CHANGED
@@ -2,6 +2,25 @@
2
2
 
3
3
  **dsh-fonttune** 的重要变更都记录在这里。英文版见 [CHANGELOG.en.md](CHANGELOG.en.md)。
4
4
 
5
+ ## [0.3.5] - 2026-09-29
6
+
7
+ ### 修复
8
+ - **字重偏移落在旧版绝对字重的数值区间里会被改写**:这类偏移读回时会被当成旧版绝对值重新换算,上限一抬高就会重现 0.3.1 那个「档位跳到 −1」。现在文档自己标明字重用的是哪套刻度,旧值只在没有标记的文档里换算一次。
9
+ - **字重滑块最高的一档会写出滑块本身表示不了的数值**:档位向上取整时越过了按字体实测的上限。现在每一档都是中位的整数倍,也不越出上下限。
10
+
11
+ ### 变更
12
+ - **字重滑块改为按「每档都看得见」挑档距**:一档取字体相邻字形里变化足够明显的那一档(不是最细的那一档),档数因此可能比之前少,但每挪一格都能看出来;正文在每一档都换字形,加粗与标题到顶后停住。
13
+
14
+ ## [0.3.4] - 2026-09-29
15
+
16
+ ### 修复
17
+ - **取值没落进文档时,滑块会安静地回到文档里的值**:写入被接受、文档里的值却没有跟着变时,滑块过一会儿自己跳回,看不出发生过什么。现在会在控件下方给出提示,说明已回到文档里的值。
18
+
19
+ ### 变更
20
+ - **字重说明写明最小的一档看起来最弱**:档距按当前字体实测,最小的一档变化幅度本来就小,说明里现在写清了这一点。
21
+ - **伪粗体与伪斜体开关写明了实际效果**:关掉「禁用伪粗体」最多为没有粗体字形的字体多出一档,变不出中间档;两个开关一起关时同理。
22
+ - **界面跟随的说明更明确**:跟随开启时,界面分区自己的字体与字重会被忽略。
23
+
5
24
  ## [0.3.3] - 2026-09-28
6
25
 
7
26
  ### 变更
@@ -16,7 +35,7 @@
16
35
 
17
36
  ### 修复
18
37
  - **字重滑块偏上的档位会跳到较小的数值**:此前有两个档位会被换算成别的数值,表现为拖到第三档显示成 −1、第四档与 0 档的粗细看起来完全一样。现在拖到哪一档就停在哪一档。
19
- - **「对话字重偏移」为 0 时,对话还是会跟着「界面字重偏移」一起变粗**:两个轴的范围互相串了,界面设了偏移时对话的 0 档也带上了那个偏移,于是 0 与 +1 两档看起来几乎一样。现在每个轴只管自己的范围,0 档就是 DSH 原样。
38
+ - **「对话字重偏移」为 0 时,对话还是会跟着「界面字重偏移」一起变粗**:两个轴的范围互相串了,界面设了偏移时对话的 0 档也带上了那个偏移,于是 0 与 +1 两档看起来几乎一样。现在每个轴只管自己的范围,0 档就是 DSH 原样。
20
39
  - **卡片里的行高预览在 100% 时比更高的档位还高**:预览与真实对话用的不是同一个基准。现在两者一致,预览里也是每一档都更高。
21
40
 
22
41
  ### 变更
package/README.en.md CHANGED
@@ -9,12 +9,12 @@
9
9
  - **Three typography sets** — the conversation (markdown paragraphs, tables, headings) comes first and owns every axis; the interface (settings sheet, sidebars, workspace, headings and buttons) offers **a font and a weight** and follows the conversation by default (switchable); code stays its own axis
10
10
  - **Interface / conversation / code fonts** — three independent fallback lists, Latin families first and CJK after; leaving one empty keeps DSH's own stack untouched
11
11
  - **Font-size offsets** — the **conversation** takes -3 ~ +6 px on top of DSH's own "conversation font size" (the official value is the base), moving paragraphs, headings and line heights together — and it is applied **once, at the source** (H1/H2/H3 all derive from the same delta, so the hierarchy holds at any offset and no heading comes out smaller than expected); code is its own axis at -3 ~ +6 px. **The interface has no size axis**: verified against DSH, the settings sheet, sidebars and workspace size their text in upstream CSS, and the only official size hook is the conversation one
12
- - **Font-weight offsets** — the **conversation**, the **interface** and **code** all take the same **relative offset** (-100 ~ +200, unset reads 0 and the readout is signed): the offset is added to each element's **own** weight, so the heading hierarchy DSH ships (h1~h3 700, h4~h6 and bold 600, table head 500, body 400) survives in both directions — headings stay clearly bolder than body text at any setting, and bold text inside a code surface stays bold. The interface offset is one rule over `body` plus an element table, with the whole conversation markdown subtree excluded: measured against computed styles on a live page, it takes every interface text element to the target and moves nothing inside the markdown subtree, so **changing the interface weight never touches the conversation**. The slider **counts steps**: the readout is the step count (for example `-1 0 +1`) and **the font decides how many there are** — the card measures how many distinct weights the chosen family can render for body text and for bold text, so one step is one pair of neighbouring faces and the range ends where those two stop swapping faces (the heading layer stops once it is at its boldest) — every notch is a visible change and the numbers stay small. What is stored is still a weight offset (older values are converted), so changing the font never breaks a setting; a family with only regular and bold offers three positions in total, and continuous control needs a family with more weights or a variable font
12
+ - **Font-weight offsets** — the **conversation**, the **interface** and **code** all take the same **relative offset** (unset reads 0, the readout is signed, and the range is measured for the current font): the offset is added to each element's **own** weight, so the heading hierarchy DSH ships (h1~h3 700, h4~h6 and bold 600, table head 500, body 400) survives in both directions — headings stay clearly bolder than body text at any setting, and bold text inside a code surface stays bold. The interface offset is one rule over `body` plus an element table, with the whole conversation markdown subtree excluded: measured against computed styles on a live page, it takes every interface text element to the target and moves nothing inside the markdown subtree, so **changing the interface weight never touches the conversation**. The slider **counts steps**: the readout is the step count (for example `-1 0 +1`) and **the font decides how many there are** — the card measures how many distinct weights the chosen family can render for body text, and one step is the smallest jump that is **clearly visible** rather than the smallest possible one, the range ending where body text stops swapping faces (bold text and headings stop once they are at their heaviest) — so the control may offer fewer positions than before while every notch is a visible change and the numbers stay small. What is stored is still a weight offset (older values are converted), so changing the font never breaks a setting; a family with only regular and bold offers two positions in total, and continuous control needs a family with more weights or a variable font
13
13
  - **Line heights** — the **conversation** uses a ratio (100% ~ 160%), code an additive offset (-4 ~ +8 px); the interface has no line-height axis, for the same reason as size
14
14
  - **Code ligatures** — a three-mode switch (default / on / off; browsers enable them by default, turning them off restores `=>` and `!=` as plain characters), plus an advanced `font-feature-settings` value field
15
15
  - **Refuse synthetic styles** (off by default, i.e. synthesis is allowed) — turning it on stops the browser from faking italic and bold for CJK faces, which have neither, so marked text stays upright; left off, the browser synthesises by its own rules, which at least gives a visible "bold" step for a family with no bold face
16
16
  - **The interface-follows-conversation switch** — a "Follows the conversation" switch at the top of the interface section (on by default): on, the interface takes the conversation's **font and weight** and its own two controls stay hidden; off, it uses its own font and weight, independent of the conversation. Size and line height belong to the conversation only (the interface has no hooks for them)
17
- - **Presets** — a dropdown select right under the edit mode: five built-in presets out of the box, pick one to apply it; with a preset selected every change auto-saves into it, and "Rename / Export / Import" manage the list (export as JSON, import-merge a paste). When the clipboard is unavailable (a non-secure context, or no clipboard permission) the export does not print a truncated message: the whole JSON goes into a selected, read-only box, so the copy shortcut works, and the box puts itself away once copied. A settings write the document **refuses** is reported on the same row instead of leaving the control quietly showing the old value
17
+ - **Presets** — a dropdown select right under the edit mode: five built-in presets out of the box, pick one to apply it; with a preset selected every change auto-saves into it, and "Rename / Export / Import" manage the list (export as JSON, import-merge a paste). When the clipboard is unavailable (a non-secure context, or no clipboard permission) the export does not print a truncated message: the whole JSON goes into a selected, read-only box, so the copy shortcut works, and the box puts itself away once copied. A settings write the document **refuses** is reported on the same row instead of leaving the control quietly showing the old value, and a write the document never took says underneath that the value came from the document
18
18
  - **West / CJK split (simple mode)** — an edit-mode switch: simple mode gives just a Western and a CJK single-pick slot per set, advanced mode is the full stack editor; both views share one stack, so toggling never changes the order you set up
19
19
  - **Font picker panel** — four curated groups (monospace / CJK / Latin / generic), always listed — while searching and even when enumeration fails — plus an "installed on this machine" group on Chromium that lists only what the curated groups do not, so no family is ever offered twice. A name that is not in the list can be created with "use xxx". A refused font permission is retried after a while, so granting it in the browser and reopening the panel fills the list in
20
20
  - **Drag to reorder** — picked fonts are draggable chips with earlier/later buttons too (keyboard and touch friendly)
@@ -26,29 +26,10 @@
26
26
 
27
27
  | Plugin version | Supported DSH versions |
28
28
  | --- | --- |
29
- | **0.3.3** (latest) | 0.1.7-alpha.1 / alpha.2, 0.1.7-rc.1 / rc.2, 0.2.0-rc.1 |
30
- | 0.3.2 | 0.1.5-rc.3, 0.1.7-alpha.1 / alpha.2, 0.1.7-rc.1 / rc.2, 0.2.0-rc.1 |
31
- | 0.3.1 | 0.1.5-rc.3, 0.1.7-alpha.1 / alpha.2, 0.1.7-rc.1 / rc.2 |
32
- | 0.3.0 | 0.1.5-rc.3, 0.1.7-alpha.1 / alpha.2, 0.1.7-rc.1 / rc.2 |
33
- | 0.2.7 | 0.1.5-rc.3, 0.1.7-alpha.1 / alpha.2, 0.1.7-rc.1 / rc.2 |
34
- | 0.2.6 | 0.1.5-rc.3, 0.1.7-alpha.1 / alpha.2, 0.1.7-rc.1 |
35
- | 0.2.5 | 0.1.5-rc.1 / rc.2 / rc.3, 0.1.7-alpha.1 / alpha.2 |
36
- | 0.2.4 | 0.1.5-rc.1 / rc.2 / rc.3, 0.1.7-alpha.1 / alpha.2 |
37
- | 0.2.3 | 0.1.5-rc.2 |
38
- | 0.2.2 | 0.1.5-rc.2 |
39
- | 0.2.1 | 0.1.5-rc.2 |
40
- | 0.2.0 | 0.1.5-rc.2 |
41
-
42
- `engines.dsh` is declared as **`>=0.1.7-alpha.1 <0.3.0-0`** (a prerelease needs its own branch: node-semver admits one only when some comparator in the range sits on that version's exact `major.minor.patch` tuple and carries a prerelease tag of its own, so a plain `>=0.1.5-rc.3` never matches `0.1.7-alpha.1`). Every difference between the lines is settled at runtime rather than by version number:
43
-
44
- - **The settings service**: up to 0.1.5-rc.x it is `settingsScope.bind({namespace})` (by namespace); 0.1.7-alpha.x and 0.1.7-rc.x use `configForms.get(<profile entry id>)` (by entry id, which the installing profile decides — so the plugin claims the form whose served schema names its own fields). Both expose the same `getSnapshot`/`subscribe`/`set`/`unset` face, so one implementation covers them.
45
- - **The loader row id IS the settings key**: from 0.1.7-rc.1 on, settings are stored per entry id, and the first start imports the removed `settings.yaml` by matching section names against it — so the row id this package ships equals its settings namespace (`dsh-fonttune`). That same id also lets the package be installed through the profile's `dsh.profile.bundles`: the plugin manager then shows it as running while the configuration page stays reachable.
46
- - **The configuration card's seat**: 0.1.5-rc.x has a keyed cell under Settings → Plugins → Plugin configuration (`settings.plugin.item`); the 0.1.7 lines dropped that slot and instead contribute an entry to the Plugins page's official list (`plugins.item`, which is how the built-in settings pages are added there), plus a per-package page for a profile that installed this plugin as a bundle (`plugins.bundle.config`). All three are registered; the one a host never declares is inert. On those pages the card **starts open** — opening the entry is the expansion gesture, and asking for a second click is exactly what this release removed.
47
- - **The host half's config values**: once the alpha marks the schema `.volatile()`, the fields the host half receives are cosmokit volatile references (`{get(),[write]}`) rather than plain values, which left the first-frame stylesheet row empty; the references are unwrapped before use.
48
- - **`inject` declares only services all three lines have** (`slots`, `locale`): declaring one a host does not provide parks the whole package — on the alpha a declared `settingsScope` kept the entire Web UI from booting. The settings service is looked up with `ctx.get(name)` instead.
49
- - **The 0.1.7 form is addressed by entry id**: while the host's `describe()` view has not arrived, the plugin does not guess a name (a wrong guess means every write is refused) — it stands in with a pending scope, adopts the real form as soon as the view is served, and re-reads immediately.
50
-
51
- The market entry also states these requirements (`engines.dsh`, `dsh.compatibility.dshReleases` and `peerDependencies` in `package.json`), so the host a version needs can be checked before installing.
29
+ | **0.3.x** (latest, 0.3.5) | 0.1.7-alpha.1, 0.1.7-alpha.2, 0.1.7-rc.1, 0.1.7-rc.2, 0.2.0-rc.1 |
30
+ | 0.2.x (0.2.8) | 0.1.5-rc.3, 0.1.7-alpha.1, 0.1.7-alpha.2, 0.1.7-rc.1, 0.1.7-rc.2 |
31
+
32
+ Each major version lists only its newest patch: defects a feature introduced were fixed in the patches after it, so within a major version the newest patch is the one to use; older patches keep working, because the plugin does not break its existing interfaces.
52
33
 
53
34
  ## Install
54
35
 
@@ -82,7 +63,7 @@ Restart DSH once afterwards and open the Web UI; changing settings needs no rest
82
63
  - **Switching following off never jumps** — the moment the switch goes off, the interface writes the font and weight offset it was **already showing** into its own fields (that is what it was following), so nothing changes on screen and the sliders continue from there; an axis the conversation does not set clears the interface's own field instead, keeping DSH's default. "Reset" on that field goes back to DSH's own weight (all three weight offsets return to 0)
83
64
  - **The interface weight cannot reach the conversation** — it is the one axis that has to cover the whole page (DSH pins its small labels' weights in upstream class rules, which nothing narrower can reach), so it is implemented as a rule with the **whole conversation markdown subtree excluded**: paragraphs, headings and bold text in the conversation are untouched
84
65
  - **Weight readouts** — all three weight axes read 0 when unset (the slider sits in the middle); no "unset" wording appears anywhere, and an absolute weight stored by an older version (300 ~ 600) is converted to its equivalent offset on read (400 → 0, 450 → +50), so nothing has to be set again
85
- - **The weight slider counts steps** — the card measures how many distinct weights the current family can render for body text and for bold text, one step being one pair of neighbouring faces, and the range ending where those two stop swapping faces (the readout is the step count, e.g. `-2 … +2`), so every notch is a visible change and the numbers stay small; changing the family re-measures it
66
+ - **The weight slider counts steps** — the card measures how many distinct weights the current family can render for body text, one step being the smallest jump that is clearly visible rather than the smallest possible one, and the range ending where body text stops swapping faces (bold text and headings stop at their heaviest; the readout is the step count, e.g. `-1 … +2`), so the control may offer fewer positions than before while every notch is a visible change and the numbers stay small; changing the family re-measures it
86
67
  - **Presets** — the dropdown select below the edit mode (默认配置 1 ~ 5, with the card's own chevron inside the box); picking one switches and auto-saves the edits that follow. "Rename" renames the current preset, "Export" copies JSON and "Import" merges a paste. Operation results ("copied to the clipboard") appear on the **right** of the row below and fade out by themselves after about 2.6 s, without moving any layout
87
68
  - **Preview** — expanding the conversation / interface / code section ends with that section's own preview box, rendering just that part
88
69
  - Settings are stored in DSH's settings document (the profile's `cordis.patch.yml` from 0.1.7 on, `settings.yaml` before that), so they travel with the profile
package/README.md CHANGED
@@ -9,12 +9,12 @@
9
9
  - **三套排印**:对话(会话 Markdown 正文、表格与标题)排在第一位、拥有全部轴;界面(设置页、侧栏、工作区与标题按钮)提供**字体与字重**、默认跟随对话(可关);代码独立成轴
10
10
  - **界面 / 对话 / 代码字体** —— 各自独立的字体回退列表,拉丁字体在前、中文字体在后;留空表示完全沿用 DSH 的字体栈
11
11
  - **字号偏移** —— **对话**字号 -3 ~ +6 px,加在 DSH 自己的「对话字号」之上(官方数值是基准),段落、标题与行高一起跟随,且**只在源头加一次**(H1/H2/H3 的尺寸都由同一条 delta 派生,任意偏移下层级都不变、也不会出现某个标题偏小);代码字号独立成轴,-3 ~ +6 px。**界面没有字号轴**:经实测 DSH 的设置页、侧栏与工作区把字号写死在上游 CSS 里,唯一官方字号接口就是「对话字号」
12
- - **字重偏移** —— **对话、界面与代码都是同一种相对偏移**(-100 ~ +200,未设置即 0、读数按 `+n` / `-n` 显示):偏移叠加在每个元素**自身的**字重上,标题仍按 DSH 的层级(h1~h3 700、h4~h6 与加粗 600、表头 500、正文 400)逐级保持"标题明显粗于正文",调重调轻都不会把层级抹平,代码块里的粗体也不会被压平。界面偏移是一条把对话 Markdown 整棵子树排除在外、只铺 `body` 与自带字重的元素表的规则:真机实测(活页面计算样式)它把界面的文本元素改到目标值、对话 markdown 里的元素一个都没动,所以**改界面字重不会碰到对话**。滑块**按档计数**:读数就是档数(例如 `-1 0 +1`),**档数由字体决定**——卡片会在页面里量出所选字体在正文与加粗文字两处实际能渲染出几种粗细,一档就是相邻的两张字形,范围也以这两处还能换到字形为限(标题那一层到顶后停住),所以每挪一格都是看得见的变化,数字也不会出现"几百几百";换字体会重新测量。文档里存的仍是字重偏移(旧值自动换算),换字体不会把设置改坏;字体只有常规与粗体两档时全范围就只有 3 档,要连续可选用字重档位多的字体或可变字体
12
+ - **字重偏移** —— **对话、界面与代码都是同一种相对偏移**(未设置即 0、读数按 `+n` / `-n` 显示,范围按当前字体实测):偏移叠加在每个元素**自身的**字重上,标题仍按 DSH 的层级(h1~h3 700、h4~h6 与加粗 600、表头 500、正文 400)逐级保持"标题明显粗于正文",调重调轻都不会把层级抹平,代码块里的粗体也不会被压平。界面偏移是一条把对话 Markdown 整棵子树排除在外、只铺 `body` 与自带字重的元素表的规则:真机实测(活页面计算样式)它把界面的文本元素改到目标值、对话 markdown 里的元素一个都没动,所以**改界面字重不会碰到对话**。滑块**按档计数**:读数就是档数(例如 `-1 0 +1`),**档数由字体决定**——卡片会在页面里量出所选字体在正文处实际能渲染出几种粗细,一档取**变化足够明显**的那一档(不是最细的那一档),范围到正文再也换不到字形为止(加粗与标题到顶后停住),所以档数可能比之前少,但每挪一格都看得出来,数字也不会出现"几百几百";换字体会重新测量。文档里存的仍是字重偏移(旧值自动换算),换字体不会把设置改坏;字体只有常规与粗体两档时就只有 2 个档位,要连续可选用字重档位多的字体或可变字体
13
13
  - **行高** —— **对话**行高用倍率(100% ~ 160%);代码行高用加法偏移(-4 ~ +8 px)。界面没有行高轴(同字号的原因)
14
14
  - **代码连字** —— 三档开关(默认 / 开启 / 关闭,浏览器默认即开启,关闭可还原 `=>`、`!=` 这类连字),高级模式另有 `font-feature-settings` 特性值输入
15
15
  - **拒绝合成样式**(默认关闭 = 允许合成) —— 打开后禁用浏览器为中文伪造的斜体与粗体(中文字体没有斜体字形,浏览器会硬掰);关着(默认)时由浏览器按自己的规则合成,字体缺粗体字形时至少还能看出"粗体"这一档
16
16
  - **界面跟随对话开关** —— 界面分区顶部的「跟随对话设置」开关(默认开启):开启时界面沿用对话的**字体与字重**,界面自己的两个控件隐藏;关闭后界面用自己的字体与字重,与对话互不影响。字号与行高只属于对话(界面没有这两个接口)
17
- - **预设方案** —— 编辑模式正下方的下拉选择框:五个默认配置开箱即用,点开选一个即应用;选中方案后所有改动自动存入该方案,右侧「改名 / 导入 / 导出」管理方案(导出 JSON 分享、导入合并)。剪贴板不可用时(非安全上下文、或没有剪贴板权限)导出不会只给一段被截断的提示,而是把完整 JSON 放进一个已选中、只读的文本框,按复制快捷键即可,复制后自动收起;任何**写设置失败**(宿主拒绝、只读部署等)都会在当前行显示出来,而不是让控件悄悄弹回旧值
17
+ - **预设方案** —— 编辑模式正下方的下拉选择框:五个默认配置开箱即用,点开选一个即应用;选中方案后所有改动自动存入该方案,右侧「改名 / 导入 / 导出」管理方案(导出 JSON 分享、导入合并)。剪贴板不可用时(非安全上下文、或没有剪贴板权限)导出不会只给一段被截断的提示,而是把完整 JSON 放进一个已选中、只读的文本框,按复制快捷键即可,复制后自动收起;任何**写设置失败**(宿主拒绝、只读部署等)都会在当前行显示出来,而不是让控件悄悄弹回旧值;写入被接受、文档里的值却没有跟着变时,滑块也会在下方说明已回到文档里的值
18
18
  - **西文 / 中文分栏(简单模式)** —— 编辑模式开关:简单模式每套字体只给「西文」「中文」两个单选格,高级模式是完整的字体栈编辑器;两种模式共用同一条栈,来回切换不改动已排好的顺序
19
19
  - **选字体面板** —— 内置 等宽 / 中文(CJK)/ 拉丁 / 通用 四组预设,Chromium 下再补上「本机已安装」分组;四组预设**任何情况下都在**(包括搜索时,也包括枚举本机字体失败时),本机分组只列出预设分组没有的字体,所以同一个字体不会出现两次;搜索不到的名字可以直接「使用 xxx」新建。字体枚举被浏览器拒绝时会在一段时间后自动重试(用户在浏览器里授予字体权限后,重新打开面板即可看到本机字体)
20
20
  - **拖拽排序** —— 已选字体是 chip 列表,可拖动调整回退顺序,同时保留前移 / 后移按钮(键盘与触屏可用)
@@ -26,29 +26,10 @@
26
26
 
27
27
  | 插件版本 | 支持的 DSH 版本 |
28
28
  | --- | --- |
29
- | **0.3.3**(最新) | 0.1.7-alpha.1 / alpha.2、0.1.7-rc.1 / rc.2、0.2.0-rc.1 |
30
- | 0.3.2 | 0.1.5-rc.3、0.1.7-alpha.1 / alpha.2、0.1.7-rc.1 / rc.2、0.2.0-rc.1 |
31
- | 0.3.1 | 0.1.5-rc.3、0.1.7-alpha.1 / alpha.2、0.1.7-rc.1 / rc.2 |
32
- | 0.3.0 | 0.1.5-rc.3、0.1.7-alpha.1 / alpha.2、0.1.7-rc.1 / rc.2 |
33
- | 0.2.7 | 0.1.5-rc.3、0.1.7-alpha.1 / alpha.2、0.1.7-rc.1 / rc.2 |
34
- | 0.2.6 | 0.1.5-rc.3、0.1.7-alpha.1 / alpha.2、0.1.7-rc.1 |
35
- | 0.2.5 | 0.1.5-rc.1 / rc.2 / rc.3、0.1.7-alpha.1 / alpha.2 |
36
- | 0.2.4 | 0.1.5-rc.1 / rc.2 / rc.3、0.1.7-alpha.1 / alpha.2 |
37
- | 0.2.3 | 0.1.5-rc.2 |
38
- | 0.2.2 | 0.1.5-rc.2 |
39
- | 0.2.1 | 0.1.5-rc.2 |
40
- | 0.2.0 | 0.1.5-rc.2 |
41
-
42
- `engines.dsh` 声明为 **`>=0.1.7-alpha.1 <0.3.0-0`**(预发布版本必须显式留分支:node-semver 只在一个范围的某个比较符与该版本落在同一个 `major.minor.patch` 元组、且自身带预发布标签时才放行,写成 `>=0.1.5-rc.3` 匹配不到 `0.1.7-alpha.1`)。三条线的差别**全部在运行时二选一,不看版本号**:
43
-
44
- - **设置服务**:0.1.5-rc.x 是 `settingsScope.bind({namespace})`(按命名空间);0.1.7-alpha.x 与 0.1.7-rc.x 换成了 `configForms.get(<profile 条目 id>)`(按条目 id,id 由安装方的 profile 决定,所以插件靠「宿主服务的那份 schema 里有没有本插件自己的字段」来认领)。两者都是 `getSnapshot/subscribe/set/unset` 同一张脸,插件只写一套。
45
- - **loader 行 id 就是设置键**:0.1.7-rc.1 起设置按入口 id 存档,首次启动还会按**同名**把旧的 `settings.yaml` 搬过去——本包自带的 loader 行 id 因此与设置命名空间一致(`dsh-fonttune`)。同名的行 id 也让这个包可以写进 profile 的 `dsh.profile.bundles` 安装:插件管理页会把它显示为运行中,配置页照旧可达。
46
- - **配置卡片座位**:0.1.5-rc.x 是 设置 → 插件 → 插件配置 里的一个 keyed 单元(`settings.plugin.item`);0.1.7 两条线删掉了这个槽位,改成在「插件」页的官方插件列表里贡献一个条目(`plugins.item`,内置那些设置页就是这么挂的),并另外提供「已安装成 bundle 时」的每包页面(`plugins.bundle.config`)。三个座位都注册,宿主不声明的那个是惰性的;卡片在这些页面里**默认展开**——点进那个条目本身就是展开手势,不该再让人多点一次。
47
- - **宿主半的配置来源**:alpha 把 schema 标成 `.volatile()` 之后,宿主半拿到的配置字段是 cosmokit 的 volatile 引用(`{get(),[write]}`)而不是普通值,首帧样式行会因此变空;插件先把引用解出来再用。
48
- - **`inject` 只声明三条线都有的服务**(`slots`、`locale`):声明一个宿主没有的服务会把整包 park 住——alpha 上声明 `settingsScope` 会让整个 Web 界面起不来。设置服务一律用 `ctx.get(name)` 现查。
49
- - **0.1.7 的表单是「条目 id + 描述视图」**:宿主 `describe()` 还没答话时,插件不会去猜一个条目名(猜错的话每次写入都会被宿主拒绝),而是先用一个等待态座位顶住,等宿主把视图发出来再接管并立刻重读。
50
-
51
- 市场条目同时声明这些兼容信息(`package.json` 的 `engines.dsh`、`dsh.compatibility.dshReleases` 与 `peerDependencies`),安装前可据此判断这一版需要的宿主版本。
29
+ | **0.3.x**(最新,0.3.5) | 0.1.7-alpha.1、0.1.7-alpha.2、0.1.7-rc.1、0.1.7-rc.2、0.2.0-rc.1 |
30
+ | 0.2.x(0.2.8) | 0.1.5-rc.3、0.1.7-alpha.1、0.1.7-alpha.2、0.1.7-rc.1、0.1.7-rc.2 |
31
+
32
+ 每个大版本只列该系列最新的一个补丁版本(新功能引入的缺陷都在其后的补丁里修掉了,所以同一个大版本内直接用最新补丁即可;旧补丁仍可继续用,插件不破坏既有接口)。
52
33
 
53
34
  ## 安装
54
35
 
@@ -82,7 +63,7 @@ dsh plugin --profile web add <插件目录路径>
82
63
  - **关掉跟随不会跳变** —— 关掉开关的那一刻,界面会把**正在显示的**字体与字重偏移写成自己的值(跟随期间它本来就是这两项),所以画面零变化、滑块从当前值继续调;对话没设的那一项则清掉界面自己的字段、保持 DSH 默认。想回到 DSH 自己的粗细点该项的「重置」(三个字重偏移读数都回到 0)
83
64
  - **界面字重不会碰到对话** —— 界面字重是唯一必须铺满整页的轴(DSH 把小标签的粗细写死在上游 CSS 的类规则里,窄规则够不到它),实现上是一条把**对话 Markdown 整棵子树排除在外**的规则,所以对话的段落、标题、粗体都不受影响
84
65
  - **字重读数** —— 三个字重轴的未设置读数都显示 0(滑块停在正中);不会出现「未设置」这类字眼;旧版本存的绝对字重(300 ~ 600)会在读取时自动换算成等价偏移(400 → 0、450 → +50),无需手动重设
85
- - **字重滑块按档计数** —— 卡片会量出当前字体在正文与加粗文字两处各能渲染出几档粗细,一档 = 相邻两张字形、上下限以这两处还能换字形为限(读数就是档数,如 `-2 … +2`),所以每挪一格都看得出变化、也不会出现"几百几百"的数字;换字体后档数会重新测量
66
+ - **字重滑块按档计数** —— 卡片会量出当前字体在正文处能渲染出几档粗细,一档取**变化足够明显**的那一档(不是最细的那一档)、上下限以正文还能换字形为限(加粗与标题到顶后停住;读数就是档数,如 `-1 … +2`),所以档数可能比之前少、但每挪一格都看得出变化,也不会出现"几百几百"的数字;换字体后档数会重新测量
86
67
  - **预设方案** —— 编辑模式下方的下拉选择框(默认配置 1 ~ 5,框内右侧有与卡片一致的下拉箭头),点开选择即切换并自动保存后续改动;「改名」重命名当前方案,「导出」复制 JSON,「导入」粘贴合并。操作结果(如「已复制到剪贴板」)显示在下面那行的**右侧**,约 2.6 秒后自动淡出,不会顶动任何布局
87
68
  - **预览** —— 对话 / 界面 / 代码分区展开后,各自分区末尾有一个预览框,只渲染该分区的样式
88
69
  - 设置保存在 DSH 的设置文档里(0.1.7 起是 profile 的 `cordis.patch.yml`,更早的版本是 `settings.yaml`),跟随 profile 走