dsh-anthropic-fonts 0.1.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 dsh-anthropic-fonts contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.en.md ADDED
@@ -0,0 +1,93 @@
1
+ # dsh-anthropic-fonts
2
+
3
+ Apply Anthropic's typefaces to the [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) Web UI:
4
+
5
+ - **Interface** (sidebar, headings, buttons, settings): `Anthropic Sans Web Text`
6
+ - **Model conversation** (Markdown body / headings / tables): `Anthropic Serif Web Text`
7
+ - **Code / code blocks**: `Anthropic Mono Variable`
8
+
9
+ CJK text falls back to the Source Han family (`Noto Sans SC` / `Source Han Sans SC` / `Noto Serif SC`), then to system fonts.
10
+
11
+ ## Fonts
12
+
13
+ The `fonts/` directory ships the three Latin fonts; install them for the best English / code rendering:
14
+
15
+ | Font | File | Role |
16
+ |---|---|---|
17
+ | Anthropic Sans Web Text | `fonts/AnthropicSansWebText.ttf` | Interface |
18
+ | Anthropic Serif Web Text | `fonts/AnthropicSerifWebText.ttf` | Conversation |
19
+ | Anthropic Mono Variable | `fonts/AnthropicMonoVariable.ttf` | Code |
20
+
21
+ Install: double-click each `.ttf` on Windows → **Install**; on macOS use **Font Book**.
22
+
23
+ Chinese needs no extra install — it falls back to the Source Han fonts (Noto Sans/Serif SC, Source Han), then to system CJK fonts.
24
+
25
+ ## Install
26
+
27
+ A standard `dsh` bundle plugin — the same shape as
28
+ [`dsh-whale-animation`](https://github.com/LeemanCheung/dsh-whale-animation).
29
+
30
+ ### CLI (recommended)
31
+
32
+ ```sh
33
+ dsh plugin --profile web add "github:Isilsolme/dsh-anthropic-fonts"
34
+ ```
35
+
36
+ `dsh plugin add` runs `pnpm add` inside the profile and auto-appends the
37
+ bundle to `dsh.profile.bundles`. Restart the web surface afterwards.
38
+
39
+ ### Manual
40
+
41
+ ```jsonc
42
+ // ~/.dsh/profiles/web/package.json
43
+ {
44
+ "dependencies": {
45
+ "dsh-anthropic-fonts": "link:C:/path/to/dsh-anthropic-fonts"
46
+ },
47
+ "dsh": {
48
+ "profile": {
49
+ "bundles": [
50
+ "@deepseek-ai/dsh-base",
51
+ "@deepseek-ai/dsh-web-app",
52
+ "dsh-anthropic-fonts"
53
+ ]
54
+ }
55
+ }
56
+ }
57
+ ```
58
+
59
+ then:
60
+
61
+ ```sh
62
+ cd ~/.dsh/profiles/web && pnpm install
63
+ ```
64
+
65
+ ## Uninstall / toggle off
66
+
67
+ ```sh
68
+ dsh plugin --profile web remove dsh-anthropic-fonts
69
+ ```
70
+
71
+ (or remove it from `dependencies` and `bundles`, then `pnpm install`).
72
+ Restart to restore the default fonts.
73
+
74
+ ## How it works
75
+
76
+ Overrides the DSH typography tokens: `--dsw-font-family` (UI) and the non-code
77
+ `--dsw-font-markdown-*` tokens (conversation body). The injected `<style>` is
78
+ owned by the client fiber and removed on uninstall.
79
+
80
+ ## Structure
81
+
82
+ - `lib/index.js` — host half (empty; the effect is browser-only)
83
+ - `lib/client.js` — client half (injects the font CSS variable overrides)
84
+ - `cordis.patch.yml` — bundle patch inserting the plugin row
85
+ - `fonts/` — the two Latin font files
86
+
87
+ ## Credits
88
+
89
+ Font stack modeled on [`blaxisomu/typora_claude`](https://github.com/blaxisomu/typora_claude) (Anthropic Web fonts for Latin, Source Han for CJK).
90
+
91
+ ## License
92
+
93
+ MIT
package/README.md ADDED
@@ -0,0 +1,88 @@
1
+ # dsh-anthropic-fonts
2
+
3
+ 给 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) Web 界面换上 Anthropic 字体:
4
+
5
+ - **界面**(侧栏、标题、按钮、设置):`Anthropic Sans Web Text`
6
+ - **模型对话**(Markdown 正文 / 标题 / 表格):`Anthropic Serif Web Text`
7
+ - **代码 / 代码块**:`Anthropic Mono Variable`
8
+
9
+ 中文回退到思源字体(`Noto Sans SC` / `Source Han Sans SC` / `Noto Serif SC`),未安装时回退到系统字体(苹方 / 微软雅黑 / 宋体)。
10
+
11
+ ## 字体
12
+
13
+ 仓库 `fonts/` 附带三个拉丁字体,安装后英文 / 代码效果最佳:
14
+
15
+ | 字体 | 文件 | 用途 |
16
+ |---|---|---|
17
+ | Anthropic Sans Web Text | `fonts/AnthropicSansWebText.ttf` | 界面 |
18
+ | Anthropic Serif Web Text | `fonts/AnthropicSerifWebText.ttf` | 模型对话 |
19
+ | Anthropic Mono Variable | `fonts/AnthropicMonoVariable.ttf` | 代码 |
20
+
21
+ 安装:Windows 双击每个 `.ttf` → 点「安装」;macOS 用「字体册」导入。
22
+
23
+ 中文无需额外安装:会回退到思源黑体 / 宋体(Noto Sans/Serif SC、Source Han),没有则用系统字体。
24
+
25
+ ## 安装
26
+
27
+ 标准的 `dsh` bundle 插件 —— 与 [`dsh-whale-animation`](https://github.com/LeemanCheung/dsh-whale-animation) 同一种形态。
28
+
29
+ ### CLI(推荐)
30
+
31
+ ```sh
32
+ dsh plugin --profile web add "github:Isilsolme/dsh-anthropic-fonts"
33
+ ```
34
+
35
+ `dsh plugin add` 会在 profile 内执行 `pnpm add`,并自动把 bundle 追加到 `dsh.profile.bundles`。之后重启 web 即可生效。
36
+
37
+ ### 手动安装
38
+
39
+ ```jsonc
40
+ // ~/.dsh/profiles/web/package.json
41
+ {
42
+ "dependencies": {
43
+ "dsh-anthropic-fonts": "link:C:/path/to/dsh-anthropic-fonts"
44
+ },
45
+ "dsh": {
46
+ "profile": {
47
+ "bundles": [
48
+ "@deepseek-ai/dsh-base",
49
+ "@deepseek-ai/dsh-web-app",
50
+ "dsh-anthropic-fonts"
51
+ ]
52
+ }
53
+ }
54
+ }
55
+ ```
56
+
57
+ 然后:
58
+
59
+ ```sh
60
+ cd ~/.dsh/profiles/web && pnpm install
61
+ ```
62
+
63
+ ## 卸载 / 关闭
64
+
65
+ ```sh
66
+ dsh plugin --profile web remove dsh-anthropic-fonts
67
+ ```
68
+
69
+ (或从 `dependencies` 和 `bundles` 里移除,再 `pnpm install`)。重启即恢复默认字体。
70
+
71
+ ## 原理
72
+
73
+ 覆盖 DSH 的排版 token:`--dsw-font-family`(UI 用),以及全部非代码的 `--dsw-font-markdown-*`(对话正文用)。注入的 `<style>` 归属 client fiber,卸载时一并清理。
74
+
75
+ ## 结构
76
+
77
+ - `lib/index.js` —— Host 半边(空;字体效果只在浏览器)
78
+ - `lib/client.js` —— Client 半边(注入字体 CSS 变量覆盖)
79
+ - `cordis.patch.yml` —— bundle patch,插入插件行
80
+ - `fonts/` —— 三个拉丁字体文件
81
+
82
+ ## 参考
83
+
84
+ 字体栈参考了 [`blaxisomu/typora_claude`](https://github.com/blaxisomu/typora_claude) 的实现(拉丁用 Anthropic Web 字体、中文回退思源字体)。
85
+
86
+ ## 许可
87
+
88
+ MIT
@@ -0,0 +1,4 @@
1
+ # dsh-anthropic-fonts: Anthropic Sans (UI) / Serif (conversation) for the DSH web surface.
2
+ - insert:
3
+ - id: anthropic-fonts
4
+ name: 'dsh-anthropic-fonts'
Binary file
Binary file
Binary file
package/lib/client.js ADDED
@@ -0,0 +1,43 @@
1
+ window.__ModuleLoader__.load({
2
+ id: "dsh-anthropic-fonts",
3
+ factory: function (require) {
4
+ var module = { exports: {} };
5
+ var exports = module.exports;
6
+
7
+ var css = "html:root{--dsw-font-family:'Anthropic Sans Web Text','Noto Sans SC','Source Han Sans SC',-apple-system,BlinkMacSystemFont,'Segoe UI','PingFang SC','Hiragino Sans GB','Microsoft YaHei','Helvetica Neue',Helvetica,Arial,sans-serif;--dsw-font-serif:'Anthropic Serif Web Text',Georgia,'Times New Roman','Noto Serif SC','Source Han Serif SC','Songti SC','SimSun',serif;--ds-font-family-code:'Anthropic Mono Variable','Source Han Sans SC',ui-monospace,'SF Mono','JetBrains Mono','Fira Code',Consolas,'Liberation Mono',Menlo,Courier,monospace}" +
8
+ "html body{" +
9
+ "--dsw-font-markdown-h1:700 24px/34px var(--dsw-font-serif);--dsw-font-markdown-h1-font-family:var(--dsw-font-serif);" +
10
+ "--dsw-font-markdown-h2:700 22px/32px var(--dsw-font-serif);--dsw-font-markdown-h2-font-family:var(--dsw-font-serif);" +
11
+ "--dsw-font-markdown-h3:700 20px/30px var(--dsw-font-serif);--dsw-font-markdown-h3-font-family:var(--dsw-font-serif);" +
12
+ "--dsw-font-markdown-h4:600 16px/28px var(--dsw-font-serif);--dsw-font-markdown-h4-font-family:var(--dsw-font-serif);" +
13
+ "--dsw-font-markdown-base:16px/28px var(--dsw-font-serif);--dsw-font-markdown-base-font-family:var(--dsw-font-serif);" +
14
+ "--dsw-font-markdown-base-strong:600 16px/28px var(--dsw-font-serif);--dsw-font-markdown-base-strong-font-family:var(--dsw-font-serif);" +
15
+ "--dsw-font-markdown-base-italic:italic 16px/28px var(--dsw-font-serif);--dsw-font-markdown-base-italic-font-family:var(--dsw-font-serif);" +
16
+ "--dsw-font-markdown-base-strong-italic:italic 600 16px/28px var(--dsw-font-serif);--dsw-font-markdown-base-strong-italic-font-family:var(--dsw-font-serif);" +
17
+ "--dsw-font-markdown-table:15px/25px var(--dsw-font-serif);--dsw-font-markdown-table-font-family:var(--dsw-font-serif);" +
18
+ "--dsw-font-markdown-table-head:500 15px/25px var(--dsw-font-serif);--dsw-font-markdown-table-head-font-family:var(--dsw-font-serif);" +
19
+ "--dsw-font-markdown-small:14px/24px var(--dsw-font-serif);--dsw-font-markdown-small-font-family:var(--dsw-font-serif);" +
20
+ "--dsw-font-markdown-small-strong:600 14px/24px var(--dsw-font-serif);--dsw-font-markdown-small-strong-font-family:var(--dsw-font-serif);" +
21
+ "--dsw-font-markdown-small-italic:italic 14px/24px var(--dsw-font-serif);--dsw-font-markdown-small-italic-font-family:var(--dsw-font-serif);" +
22
+ "--dsw-font-markdown-small-strong-italic:italic 600 14px/24px var(--dsw-font-serif);--dsw-font-markdown-small-strong-italic-font-family:var(--dsw-font-serif);" +
23
+ "}";
24
+
25
+ function apply(ctx) {
26
+ if (typeof document === "undefined") return;
27
+ var tagId = "dsh-anthropic-fonts/fonts.css";
28
+ if (document.querySelector('style[data-plugin-css=' + JSON.stringify(tagId) + ']') !== null) return;
29
+ var tag = document.createElement("style");
30
+ tag.dataset.plugin = "dsh-anthropic-fonts";
31
+ tag.dataset.pluginCss = tagId;
32
+ tag.textContent = css;
33
+ document.head.appendChild(tag);
34
+ ctx.effect(function () {
35
+ return function () { tag.remove(); };
36
+ });
37
+ }
38
+
39
+ exports.apply = apply;
40
+ exports.inject = [];
41
+ return module.exports;
42
+ }
43
+ });
package/lib/index.js ADDED
@@ -0,0 +1,3 @@
1
+ /** Host half is intentionally empty; the font effect is browser-only. */
2
+ export const name = 'dsh-anthropic-fonts'
3
+ export function apply() {}
package/package.json ADDED
@@ -0,0 +1,54 @@
1
+ {
2
+ "name": "dsh-anthropic-fonts",
3
+ "version": "0.1.0",
4
+ "description": "Switch the DSH web interface to Anthropic Sans Web Text and model conversation to Anthropic Serif Web Text.",
5
+ "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/Isilsolme/dsh-anthropic-fonts.git"
9
+ },
10
+ "homepage": "https://github.com/Isilsolme/dsh-anthropic-fonts#readme",
11
+ "bugs": {
12
+ "url": "https://github.com/Isilsolme/dsh-anthropic-fonts/issues"
13
+ },
14
+ "type": "module",
15
+ "main": "lib/index.js",
16
+ "exports": {
17
+ ".": "./lib/index.js",
18
+ "./client": "./lib/client.js",
19
+ "./package.json": "./package.json"
20
+ },
21
+ "files": [
22
+ "lib",
23
+ "fonts",
24
+ "cordis.patch.yml",
25
+ "README.md",
26
+ "README.en.md",
27
+ "LICENSE"
28
+ ],
29
+ "keywords": [
30
+ "dsh",
31
+ "deepseek-harness",
32
+ "dsh-plugin",
33
+ "cordis",
34
+ "web-ui",
35
+ "font",
36
+ "anthropic"
37
+ ],
38
+ "engines": {
39
+ "node": ">=20"
40
+ },
41
+ "dsh": {
42
+ "bundle": {
43
+ "patch": "./cordis.patch.yml"
44
+ },
45
+ "client": {
46
+ "inject": [],
47
+ "platform": "web",
48
+ "immediately": true
49
+ }
50
+ },
51
+ "peerDependencies": {
52
+ "@deepseek-ai/cordis": "^4.0.1"
53
+ }
54
+ }