dsh-fonttune 0.3.5 → 0.4.0
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 +25 -0
- package/CHANGELOG.md +25 -0
- package/README.en.md +5 -2
- package/README.md +5 -2
- package/lib/client.js +10231 -5453
- package/lib/index.js +75 -3
- package/lib/shared.cjs +1329 -5
- package/package.json +3 -2
package/CHANGELOG.en.md
CHANGED
|
@@ -2,6 +2,31 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to **dsh-fonttune** are documented here. Chinese version: [CHANGELOG.md](CHANGELOG.md).
|
|
4
4
|
|
|
5
|
+
## [0.4.0] - 2026-10-01
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
- **A floating tuning panel**: the dot in the conversation's corner unfolds into a card with the conversation's font size, line height and weight at hand. The dot snaps to the conversation region's corners and unfolds from its own, and the panel remembers its size and position.
|
|
9
|
+
- **A settings entry on the panel**: the button left of its close takes you straight to this plugin's own settings page, no hunting through the plugin list.
|
|
10
|
+
- **A text rendering choice**: follow the system, sharp, or smooth — the same face drawn with a different stroke feel.
|
|
11
|
+
- **A master switch for the panel**: the settings page can turn the floating panel off, and the corner dot is gone for good.
|
|
12
|
+
|
|
13
|
+
### Fixes
|
|
14
|
+
- **The settings page stuttered the first time it was opened after a refresh or restart**: the first open is now as smooth as every later one.
|
|
15
|
+
|
|
16
|
+
### Changes
|
|
17
|
+
- **The panel's unfold and fold ignore the system's "reduce motion" setting**: the animations play even with reduced motion on.
|
|
18
|
+
- **Compact choices moved onto their title row**: controls like the code ligature choice no longer sit under the hint text, but line up with the other switches.
|
|
19
|
+
|
|
20
|
+
## [0.3.6] - 2026-09-29
|
|
21
|
+
|
|
22
|
+
### Fixes
|
|
23
|
+
- **A weight change took a long time to take effect**: an adjustment now submits the setting once, and consecutive adjustments are merged.
|
|
24
|
+
- **The text briefly jumped back while the weight was adjusted**: the page keeps the value you chose until the write is confirmed.
|
|
25
|
+
- **A "not written to the document" notice appeared while the write was still going**: the notice now appears only when the host actually refuses the write.
|
|
26
|
+
|
|
27
|
+
### Changes
|
|
28
|
+
- **A weight change is reflected on the page immediately**, instead of after the setting has been written.
|
|
29
|
+
|
|
5
30
|
## [0.3.5] - 2026-09-29
|
|
6
31
|
|
|
7
32
|
### Fixed
|
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,31 @@
|
|
|
2
2
|
|
|
3
3
|
**dsh-fonttune** 的重要变更都记录在这里。英文版见 [CHANGELOG.en.md](CHANGELOG.en.md)。
|
|
4
4
|
|
|
5
|
+
## [0.4.0] - 2026-10-01
|
|
6
|
+
|
|
7
|
+
### 新增
|
|
8
|
+
- **悬浮调参面板**:对话角落的小圆点展开为一张卡片,对话字号、行高、字重随手可调。小圆点吸附在对话区域的四角,展开方向随所在角落,面板的大小与位置会自动记住。
|
|
9
|
+
- **面板上的设置入口**:关闭按钮左侧的按钮直达「字体增强」自己的设置页,不用再去插件列表里找。
|
|
10
|
+
- **文字渲染质感**:设置页新增「跟随系统 / 锐利 / 圆润」三档,同一副字体换一种笔画质感。
|
|
11
|
+
- **面板总开关**:设置页可以关掉悬浮面板,角落的小圆点彻底隐藏。
|
|
12
|
+
|
|
13
|
+
### 修复
|
|
14
|
+
- **硬刷新或重启后第一次打开设置页会顿一下**:现在第一次打开与之后各次一样顺滑。
|
|
15
|
+
|
|
16
|
+
### 变更
|
|
17
|
+
- **面板的展开与收起动画不受系统「减少动效」影响**:即使系统开着减少动效,面板动画照常播放。
|
|
18
|
+
- **设置页里的选择控件移到标题行右侧**:代码连字这类紧凑选择不再垫在说明文字下方,与其他开关对齐成一行。
|
|
19
|
+
|
|
20
|
+
## [0.3.6] - 2026-09-29
|
|
21
|
+
|
|
22
|
+
### 修复
|
|
23
|
+
- **调整字重挡位后等待较久才生效**:一次调整只写入一次设置,连续调整会合并为一次,等待明显缩短。
|
|
24
|
+
- **调整字重时文字会短暂回跳**:写入确认到达之前,页面保持你最后选择的值,不再来回变动。
|
|
25
|
+
- **写入尚未完成时出现「未写入文档」提示**:该提示现在只在宿主确实拒绝写入时出现。
|
|
26
|
+
|
|
27
|
+
### 变更
|
|
28
|
+
- **调整字重后页面立即反映新值**,不再等待设置写入完成。
|
|
29
|
+
|
|
5
30
|
## [0.3.5] - 2026-09-29
|
|
6
31
|
|
|
7
32
|
### 修复
|
package/README.en.md
CHANGED
|
@@ -7,11 +7,13 @@
|
|
|
7
7
|
## Features
|
|
8
8
|
|
|
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
|
+
- **A floating tuning panel** — the dot in the conversation's corner unfolds into a card with the conversation's font size, line height and weight at hand; the dot snaps to the conversation region's corners and unfolds from its own, the panel remembers its size and position; the button on its top right takes you to this plugin's own settings page, where the panel can be turned off entirely (the dot is gone for good); the unfold and fold animations ignore the system's "reduce motion" setting
|
|
10
11
|
- **Interface / conversation / code fonts** — three independent fallback lists, Latin families first and CJK after; leaving one empty keeps DSH's own stack untouched
|
|
11
12
|
- **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
13
|
- **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
14
|
- **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
15
|
- **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
|
|
16
|
+
- **Text rendering** — three modes: follow the system (default) / sharp / smooth. The same face draws with a different stroke feel — sharp is crisp and firm, smooth is soft and even
|
|
15
17
|
- **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
18
|
- **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
19
|
- **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
|
|
@@ -22,11 +24,12 @@
|
|
|
22
24
|
|
|
23
25
|
## Compatibility
|
|
24
26
|
|
|
25
|
-
**One package serves three host lines** — 0.1.7-alpha.1 / alpha.2 (the floor), 0.1.7-rc.1 / rc.2 and 0.2.0-rc.1 — and the install is the same on any of them: all three were verified for "the settings card opens, the stylesheet really reaches the page, and a change made in the card is written through".
|
|
27
|
+
**One package serves three host lines** — 0.1.7-alpha.1 / alpha.2 (the floor), 0.1.7-rc.1 / rc.2 and 0.2.0-rc.1 / rc.2 — and the install is the same on any of them: all three were verified for "the settings card opens, the stylesheet really reaches the page, and a change made in the card is written through".
|
|
26
28
|
|
|
27
29
|
| Plugin version | Supported DSH versions |
|
|
28
30
|
| --- | --- |
|
|
29
|
-
| **0.
|
|
31
|
+
| **0.4.x** (latest, 0.4.0) | 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, 0.2.0-rc.2 |
|
|
32
|
+
| 0.3.x (0.3.6) | 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, 0.2.0-rc.2 |
|
|
30
33
|
| 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
34
|
|
|
32
35
|
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.
|
package/README.md
CHANGED
|
@@ -7,11 +7,13 @@
|
|
|
7
7
|
## 功能
|
|
8
8
|
|
|
9
9
|
- **三套排印**:对话(会话 Markdown 正文、表格与标题)排在第一位、拥有全部轴;界面(设置页、侧栏、工作区与标题按钮)提供**字体与字重**、默认跟随对话(可关);代码独立成轴
|
|
10
|
+
- **悬浮调参面板** —— 对话角落的小圆点展开为卡片,对话字号、行高、字重随手可调;小圆点吸附在对话区域的四角、展开方向随所在角落,面板大小与位置自动记住;面板右上角有直达本插件设置页的按钮,设置页里可把面板整体关闭(小圆点彻底隐藏);展开与收起动画不受系统「减少动效」设置影响
|
|
10
11
|
- **界面 / 对话 / 代码字体** —— 各自独立的字体回退列表,拉丁字体在前、中文字体在后;留空表示完全沿用 DSH 的字体栈
|
|
11
12
|
- **字号偏移** —— **对话**字号 -3 ~ +6 px,加在 DSH 自己的「对话字号」之上(官方数值是基准),段落、标题与行高一起跟随,且**只在源头加一次**(H1/H2/H3 的尺寸都由同一条 delta 派生,任意偏移下层级都不变、也不会出现某个标题偏小);代码字号独立成轴,-3 ~ +6 px。**界面没有字号轴**:经实测 DSH 的设置页、侧栏与工作区把字号写死在上游 CSS 里,唯一官方字号接口就是「对话字号」
|
|
12
13
|
- **字重偏移** —— **对话、界面与代码都是同一种相对偏移**(未设置即 0、读数按 `+n` / `-n` 显示,范围按当前字体实测):偏移叠加在每个元素**自身的**字重上,标题仍按 DSH 的层级(h1~h3 700、h4~h6 与加粗 600、表头 500、正文 400)逐级保持"标题明显粗于正文",调重调轻都不会把层级抹平,代码块里的粗体也不会被压平。界面偏移是一条把对话 Markdown 整棵子树排除在外、只铺 `body` 与自带字重的元素表的规则:真机实测(活页面计算样式)它把界面的文本元素改到目标值、对话 markdown 里的元素一个都没动,所以**改界面字重不会碰到对话**。滑块**按档计数**:读数就是档数(例如 `-1 0 +1`),**档数由字体决定**——卡片会在页面里量出所选字体在正文处实际能渲染出几种粗细,一档取**变化足够明显**的那一档(不是最细的那一档),范围到正文再也换不到字形为止(加粗与标题到顶后停住),所以档数可能比之前少,但每挪一格都看得出来,数字也不会出现"几百几百";换字体会重新测量。文档里存的仍是字重偏移(旧值自动换算),换字体不会把设置改坏;字体只有常规与粗体两档时就只有 2 个档位,要连续可选用字重档位多的字体或可变字体
|
|
13
14
|
- **行高** —— **对话**行高用倍率(100% ~ 160%);代码行高用加法偏移(-4 ~ +8 px)。界面没有行高轴(同字号的原因)
|
|
14
15
|
- **代码连字** —— 三档开关(默认 / 开启 / 关闭,浏览器默认即开启,关闭可还原 `=>`、`!=` 这类连字),高级模式另有 `font-feature-settings` 特性值输入
|
|
16
|
+
- **文字渲染质感** —— 三档:跟随系统(默认)/ 锐利 / 圆润。同一副字体在不同渲染方式下笔画质感不同,锐利更清晰硬朗、圆润更柔和均匀
|
|
15
17
|
- **拒绝合成样式**(默认关闭 = 允许合成) —— 打开后禁用浏览器为中文伪造的斜体与粗体(中文字体没有斜体字形,浏览器会硬掰);关着(默认)时由浏览器按自己的规则合成,字体缺粗体字形时至少还能看出"粗体"这一档
|
|
16
18
|
- **界面跟随对话开关** —— 界面分区顶部的「跟随对话设置」开关(默认开启):开启时界面沿用对话的**字体与字重**,界面自己的两个控件隐藏;关闭后界面用自己的字体与字重,与对话互不影响。字号与行高只属于对话(界面没有这两个接口)
|
|
17
19
|
- **预设方案** —— 编辑模式正下方的下拉选择框:五个默认配置开箱即用,点开选一个即应用;选中方案后所有改动自动存入该方案,右侧「改名 / 导入 / 导出」管理方案(导出 JSON 分享、导入合并)。剪贴板不可用时(非安全上下文、或没有剪贴板权限)导出不会只给一段被截断的提示,而是把完整 JSON 放进一个已选中、只读的文本框,按复制快捷键即可,复制后自动收起;任何**写设置失败**(宿主拒绝、只读部署等)都会在当前行显示出来,而不是让控件悄悄弹回旧值;写入被接受、文档里的值却没有跟着变时,滑块也会在下方说明已回到文档里的值
|
|
@@ -22,11 +24,12 @@
|
|
|
22
24
|
|
|
23
25
|
## 兼容性
|
|
24
26
|
|
|
25
|
-
**一份包同时支持三条宿主线**——0.1.7-alpha.1 / alpha.2(下限)、0.1.7-rc.1 / rc.2、0.2.0-rc.1:安装方式与宿主线无关,三条线都验证过「设置卡片可用、样式真的作用到页面、卡片上的改动写得进去」。
|
|
27
|
+
**一份包同时支持三条宿主线**——0.1.7-alpha.1 / alpha.2(下限)、0.1.7-rc.1 / rc.2、0.2.0-rc.1 / rc.2:安装方式与宿主线无关,三条线都验证过「设置卡片可用、样式真的作用到页面、卡片上的改动写得进去」。
|
|
26
28
|
|
|
27
29
|
| 插件版本 | 支持的 DSH 版本 |
|
|
28
30
|
| --- | --- |
|
|
29
|
-
| **0.
|
|
31
|
+
| **0.4.x**(最新,0.4.0) | 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、0.2.0-rc.2 |
|
|
32
|
+
| 0.3.x(0.3.6) | 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、0.2.0-rc.2 |
|
|
30
33
|
| 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
34
|
|
|
32
35
|
每个大版本只列该系列最新的一个补丁版本(新功能引入的缺陷都在其后的补丁里修掉了,所以同一个大版本内直接用最新补丁即可;旧补丁仍可继续用,插件不破坏既有接口)。
|