diff --git a/docs/操作指南.md b/docs/操作指南.md index df92f5b..ff0938b 100644 --- a/docs/操作指南.md +++ b/docs/操作指南.md @@ -306,11 +306,21 @@ sudo sysctl fs.inotify.max_user_watches=524288 | 层级 | 字体 | 用在哪 | |---|---|---| -| 门面点睛(楷)| 霞鹜文楷 `LXGW WenKai` | 站点名、首页那句话、卡片标题 | -| 标题(宋)| 思源宋体 `Noto Serif SC Variable` | 文章标题、页面标题 | +| 门面整体(宋)| 霞鹜新致宋 `LXGW Neo ZhiSong` | 门面档全部文字(站点名、首页那句话、卡片标题、UI)| +| 标题(宋)| 思源宋体 `Noto Serif SC Variable` | 文章页标题、页面标题 | | 正文/UI(黑)| 思源黑体 `Noto Sans SC Variable` | 文章正文、界面、按钮 | | 西文 | `Inter Variable` + `Playfair Display` | 西文与数字、展示衬线 | +门面(`fontProfile="interface"`)整体走宋体,文章页保持黑体 —— 宋体在长正文里 +不如黑体好读。门面之所以能用宋体,是因为它没有大段正文。 + +> ⚠️ **霞鹜新致宋只有 ZeoSeven 有分包版本。** jsdelivr 上的 +> `lxgw-neo-zhisong-webfont` 是**单文件 4.45 MB、没有 unicode-range**, +> 每次全量下载,**不能用**。ZeoSeven 把它切成 145 个 unicode-range 分包, +> 浏览器只下页面用到的那几个。 +> 另外它**只有 400 一个字重**,门面里的 `font-medium/semibold/bold` +> 都是浏览器合成的加粗;嫌糊就把那几处改成常规字重。 + 字族名的对应关系写在 `src/styles/global.css` 的 `--font-*` token 里。 改字体只需动这两处,不用碰组件。 diff --git a/src/data/reading.json b/src/data/reading.json index 0104cf9..a3b704c 100644 --- a/src/data/reading.json +++ b/src/data/reading.json @@ -1,5 +1,5 @@ { - "updatedAt": "2026-09-17T11:35:09.881Z", + "updatedAt": "2026-09-17T11:44:18.544Z", "source": "weread", "books": [ { @@ -10,10 +10,10 @@ "cover": "https://wfqqreader-1252317822.image.myqcloud.com/cover/299/26678299/t6_26678299.jpg", "progress": 35, "finished": false, - "lastReadAt": "2026-09-16T15:43:49.000Z", + "lastReadAt": "2026-09-17T11:43:28.000Z", "startedAt": "2026-09-04T16:07:07.000Z", "finishedAt": null, - "readingSeconds": 4673, + "readingSeconds": 4678, "deepLink": "https://weread.qq.com/book-detail?type=1&v=34c329807197141b34cf1db" }, { diff --git a/src/layouts/BaseLayout.astro b/src/layouts/BaseLayout.astro index c4faa97..1b6644f 100644 --- a/src/layouts/BaseLayout.astro +++ b/src/layouts/BaseLayout.astro @@ -45,6 +45,9 @@ const { const isInterfaceProfile = fontProfile === "interface" const FONTSOURCE_CDN = "https://cdn.jsdelivr.net/npm" +const ZEO_SEVEN_CDN = "https://fontsapi.zeoseven.com" +/** 霞鹜新致宋。145 个 unicode-range 分包,CSS 约 54 KB(gzip) */ +const ZHI_SONG_CSS = `${ZEO_SEVEN_CDN}/22/main/result.css` /* * 字体清单。全部走 jsdelivr 上的 Fontsource 包,不再依赖 Google Fonts。 @@ -63,13 +66,14 @@ const fontStylesheets = [ // 中文黑体(正文/UI)与宋体(标题) `${FONTSOURCE_CDN}/@fontsource-variable/noto-sans-sc@5/index.css`, `${FONTSOURCE_CDN}/@fontsource-variable/noto-serif-sc@5/index.css`, - // 门面点睛:霞鹜文楷(regular + bold) - ...(isInterfaceProfile - ? [ - `${FONTSOURCE_CDN}/lxgw-wenkai-webfont@1.7.0/lxgwwenkai-regular.css`, - `${FONTSOURCE_CDN}/lxgw-wenkai-webfont@1.7.0/lxgwwenkai-bold.css`, - ] - : []), + /* + * 门面点睛:霞鹜新致宋(LXGW Neo ZhiSong)。 + * + * 它只有 ZeoSeven 有带 unicode-range 分包的版本 —— jsdelivr 上那个 + * lxgw-neo-zhisong-webfont 是**单文件 4.45 MB、无分包**,每次全量下载,不能用。 + * ZeoSeven 把字体切成 145 个 unicode-range 分包,浏览器只下页面用到的那几个。 + */ + ...(isInterfaceProfile ? [ZHI_SONG_CSS] : []), ] const canonicalUrl = canonical || Astro.url.toString() const resolvedOgTitle = ogTitle || title @@ -102,6 +106,7 @@ const resolvedTwitterDescription = twitterDescription || description {/* 字体全部走 jsdelivr 上的 Fontsource:CJK 用可变字体 + unicode-range 分包, 不再依赖 Google Fonts(国内访问不稳)。清单见上方 fontStylesheets。 */} + {isInterfaceProfile ? : null} {fontStylesheets.map((href) => )} diff --git a/src/styles/global.css b/src/styles/global.css index acdd76a..4813bda 100644 --- a/src/styles/global.css +++ b/src/styles/global.css @@ -170,8 +170,8 @@ * 层次:楷(门面点睛)> 宋(标题)> 黑(正文/UI) */ --font-sans: "Inter Variable", "Noto Sans SC Variable", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif; - /* 霞鹜文楷只在门面档加载;文章页没加载它,会自动退回思源黑体,所以它排第二位 */ - --font-display-sans: "LXGW WenKai", "Noto Sans SC Variable", "PingFang SC", "Microsoft YaHei", sans-serif; + /* 门面点睛字体。霞鹜新致宋只在门面档加载,文章页会自动退回思源黑体,故排第二位 */ + --font-display-sans: "LXGW Neo ZhiSong", "Noto Sans SC Variable", "PingFang SC", "Microsoft YaHei", sans-serif; --font-serif: "Noto Serif SC Variable", "Source Han Serif SC", "Playfair Display", "Georgia", serif; --font-serif-cn: "Noto Serif SC Variable", "Source Han Serif SC", "Georgia", serif; --font-display-serif: "Playfair Display", "Georgia", serif; @@ -257,8 +257,19 @@ } } -/* 两档现在都用思源黑体,不再需要按档覆盖字族。 - font-profile-interface 这个 class 保留 —— 它现在只决定是否额外加载霞鹜文楷。 */ +/* + * 门面档整体改用霞鹜新致宋(宋体)。 + * + * 文章页不受影响,仍是思源黑体 —— 宋体在长正文里不如黑体好读。 + * 新致宋只有 400 一个字重,所以门面里的 font-medium / font-semibold / font-bold + * 都由浏览器合成加粗;如果看起来发糊,把那几处的字重去掉改成常规字重即可。 + * + * 字形上它衍生于 IPAmj 明朝,笔画比思源宋体更瘦、更「印刷」,配纸纹底很搭。 + */ +body.font-profile-interface, +body.font-profile-interface .font-sans { + font-family: "LXGW Neo ZhiSong", "Noto Sans SC Variable", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif; +} /* Custom smooth scrolling (avoid hash navigation animation) */ html {