Commit c3f8cb2
committed
refactor(theme): 以 TensentypeCode 单文件字体替换 GoogleSansCode 分片方案
[变更性质]
本提交为字体系统的重构,移除原有的 GoogleSansCode 5 分片方案,改为单文件 TensentypeCode 字体。
[重构动机]
原有方案依赖 5 个 woff2 分片(latin-base / latin-ext / cjk-common / cjk-ext / symbols)及 CarroisSong.ttf,
管理复杂且体积较大。统一替换为 TensentypeCode.woff2 单文件,简化字体加载链路。
[重构方案]
- 删除 themes/theme/source/fonts/ 下所有旧字体文件(5 个 woff2 分片 + CarroisSong.ttf + GoogleSansCode-Regular.ttf 源文件)
- font-slices.styl:将 5 个 @font-face 合并为单个,font-family 改为 'TensentypeCode'
- variable.styl:$font-family 改为 'TensentypeCode'
- head.ejs:preload 从两个分片改为单个 TensentypeCode.woff2
- source/fonts/ 新增 TensentypeCode.woff2 字体文件
[影响范围]
- 涉及主题层 CSS 变量、font-face 定义、HTML preload 三处修改
- 构建产物 fonts/ 目录从 ~6.3MB 降至 ~1.4MB
- 浏览器行为由 unicode-range 按需加载变为单文件整体加载,减少连接数但可能增加首次加载量1 parent e5acc81 commit c3f8cb2
11 files changed
Lines changed: 7 additions & 46 deletions
File tree
- source/fonts
- themes/theme
- layout/partials
- source
- css
- fonts
- src
Binary file not shown.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
43 | | - | |
44 | | - | |
| 42 | + | |
| 43 | + | |
45 | 44 | | |
46 | 45 | | |
47 | 46 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
| 1 | + | |
| 2 | + | |
3 | 3 | | |
4 | | - | |
5 | 4 | | |
6 | | - | |
| 5 | + | |
7 | 6 | | |
8 | 7 | | |
9 | 8 | | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
| 9 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
0 commit comments