diff --git a/README.md b/README.md index 79eb5ef..d0ab96c 100644 --- a/README.md +++ b/README.md @@ -76,16 +76,14 @@ pnpm dlx wrangler pages deploy .output/public ## 数据来源 - -| 用途 | 来源 | 许可 | -| -------------------------------- | -------------------------------------------------------------------------------------------- | --------------------------------------------------------- | -| 判定四地字形差异 | [Adobe Source Han Sans / Serif(CMap 资源)](https://github.com/adobe-fonts/source-han-sans) | [SIL OFL 1.1](https://openfontlicense.org/) | -| 页面展示用字体 | [Noto Sans CJK / Noto Serif CJK](https://github.com/notofonts/noto-cjk) | [SIL OFL 1.1](https://openfontlicense.org/) | -| 简繁、港台异体、日本新旧字体对应 | [OpenCC 开放中文转换](https://github.com/BYVoid/OpenCC) | [Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0) | -| 四地标准字表 | [zispace/hanzi-chars](https://github.com/zispace/hanzi-chars) | [仓库未声明](https://github.com/zispace/hanzi-chars) | -| 笔画数、读音 | [Unicode Han Database (Unihan)](https://www.unicode.org/reports/tr38/) | [Unicode License v3](https://www.unicode.org/license.txt) | -| 大陆字频排名 | [hanziDB.csv(Jun Da《现代汉语单字频率列表》)](https://github.com/ruddfawcett/hanziDB.csv) | [MIT](https://opensource.org/licenses/MIT) | - +| 用途 | 来源 | 许可 | +| --- | --- | --- | +| 判定四地字形差异 | [Adobe Source Han Sans / Serif(CMap 资源)](https://github.com/adobe-fonts/source-han-sans) | [SIL OFL 1.1](https://openfontlicense.org/) | +| 页面展示用字体 | [Noto Sans / Noto Serif(含 CJK)](https://github.com/notofonts/noto-cjk) | [SIL OFL 1.1](https://openfontlicense.org/) | +| 简繁、港台异体、日本新旧字体对应 | [OpenCC 开放中文转换](https://github.com/BYVoid/OpenCC) | [Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0) | +| 四地标准字表 | [zispace/hanzi-chars](https://github.com/zispace/hanzi-chars) | [仓库未声明](https://github.com/zispace/hanzi-chars) | +| 笔画数、读音 | [Unicode Han Database (Unihan)](https://www.unicode.org/reports/tr38/) | [Unicode License v3](https://www.unicode.org/license.txt) | +| 大陆字频排名 | [hanziDB.csv(Jun Da《现代汉语单字频率列表》)](https://github.com/ruddfawcett/hanziDB.csv) | [MIT](https://opensource.org/licenses/MIT) | 原始规范出处:《通用规范汉字表》(2013)、臺灣《常用國字標準字體表》(1982)、香港《常用字字形表》、日本《常用漢字表》(2010)与《学年別漢字配当表》(2017)。 diff --git a/app/styles/vars.css b/app/styles/vars.css index 0703315..5306fc8 100644 --- a/app/styles/vars.css +++ b/app/styles/vars.css @@ -31,8 +31,13 @@ --font-ui: 'UI Latin Sans', 'UI zh-CN Sans', 'Noto Sans', 'Noto Sans SC', ui-sans-serif, system-ui, sans-serif; - --font-mono: - 'UI Mono', 'IBM Plex Mono', ui-monospace, SFMono-Regular, monospace; + /* The data columns -- codepoints, stroke counts, frequency ranks -- used to + have a face of their own. They no longer need one: Noto Sans and Noto + Serif set their figures on a fixed width already, so the columns line up + in the interface face, and following it keeps the numbers in step with + the language and with the typeface switch. The monospace tail is a last + resort for a reader whose webfonts never arrive. */ + --font-mono: var(--font-ui), ui-monospace, SFMono-Regular, monospace; } html[lang='zh-TW'] { diff --git a/public/data/sources.json b/public/data/sources.json index e0a98e0..3f1e799 100644 --- a/public/data/sources.json +++ b/public/data/sources.json @@ -23,14 +23,14 @@ "zh-TW": "頁面顯示用字體", "zh-HK": "頁面顯示用字體" }, - "name": "Noto Sans CJK / Noto Serif CJK", + "name": "Noto Sans / Noto Serif(含 CJK)", "homepage": "https://github.com/notofonts/noto-cjk", "license": "SIL OFL 1.1", "licenseUrl": "https://openfontlicense.org/", "note": { - "zh-CN": "本站字体是按表内用字子集化后的产物,OFL 声明随附于 /fonts/OFL.txt。", - "zh-TW": "本站字體是按表內用字子集化後的產物,OFL 聲明隨附於 /fonts/OFL.txt。", - "zh-HK": "本站字體是按表內用字子集化後的產物,OFL 聲明隨附於 /fonts/OFL.txt。" + "zh-CN": "汉字取自 CJK 版本,拉丁字母与数字取自拉丁版本,都按站内用字子集化后自托管,OFL 声明随附于 /fonts/OFL.txt。", + "zh-TW": "漢字取自 CJK 版本,拉丁字母與數字取自拉丁版本,都按站內用字子集化後自行託管,OFL 聲明隨附於 /fonts/OFL.txt。", + "zh-HK": "漢字取自 CJK 版本,拉丁字母與數字取自拉丁版本,都按站內用字子集化後自行託管,OFL 聲明隨附於 /fonts/OFL.txt。" } }, { diff --git a/scripts/build-fonts.ts b/scripts/build-fonts.ts index 390c7b0..8aaa219 100644 --- a/scripts/build-fonts.ts +++ b/scripts/build-fonts.ts @@ -273,25 +273,6 @@ for (const style of STYLES) { console.error(`${file} ${(subset.length / 1024).toFixed(0)} KB`) } -{ - // The data columns -- codepoints, stroke counts, frequency ranks -- are set - // in one weight, so one static cut covers them - const subset = await subsetFont( - await raw('font/IBMPlexMono-Regular.woff2'), - ASCII + PUNCTUATION, - { targetFormat: 'woff2', noLayoutClosure: true }, - ) - await writeFile(join(FONT_DIR, 'ui-mono.woff2'), subset) - faces.ui!.push( - `@font-face { - font-family: 'UI Mono'; - src: url('/fonts/ui-mono.woff2') format('woff2'); - font-display: swap; -}`, - ) - console.error(`ui-mono.woff2 ${(subset.length / 1024).toFixed(0)} KB`) -} - /** * The typeface switch labels itself with 黑 and 宋, each set in the face it * names, so the two designs have to be on screen at once -- which no single diff --git a/scripts/sources.ts b/scripts/sources.ts index a08aa55..d311563 100644 --- a/scripts/sources.ts +++ b/scripts/sources.ts @@ -64,17 +64,17 @@ export const SOURCES: Source[] = [ 'zh-TW': '頁面顯示用字體', 'zh-HK': '頁面顯示用字體', }, - name: 'Noto Sans CJK / Noto Serif CJK', + name: 'Noto Sans / Noto Serif(含 CJK)', homepage: 'https://github.com/notofonts/noto-cjk', license: 'SIL OFL 1.1', licenseUrl: 'https://openfontlicense.org/', note: { 'zh-CN': - '本站字体是按表内用字子集化后的产物,OFL 声明随附于 /fonts/OFL.txt。', + '汉字取自 CJK 版本,拉丁字母与数字取自拉丁版本,都按站内用字子集化后自托管,OFL 声明随附于 /fonts/OFL.txt。', 'zh-TW': - '本站字體是按表內用字子集化後的產物,OFL 聲明隨附於 /fonts/OFL.txt。', + '漢字取自 CJK 版本,拉丁字母與數字取自拉丁版本,都按站內用字子集化後自行託管,OFL 聲明隨附於 /fonts/OFL.txt。', 'zh-HK': - '本站字體是按表內用字子集化後的產物,OFL 聲明隨附於 /fonts/OFL.txt。', + '漢字取自 CJK 版本,拉丁字母與數字取自拉丁版本,都按站內用字子集化後自行託管,OFL 聲明隨附於 /fonts/OFL.txt。', }, }, { @@ -224,12 +224,6 @@ export const ASSETS: Record = { 'main', 'fonts/NotoSerif/unhinted/variable-ttf/NotoSerif%5Bwdth,wght%5D.ttf', ), - 'font/IBMPlexMono-Regular.woff2': gh( - 'IBM/plex', - 'master', - 'packages/plex-mono/fonts/complete/woff2/IBMPlexMono-Regular.woff2', - ), - 'font/OFL.txt': gh('notofonts/noto-cjk', 'main', 'Sans/LICENSE'), }