Skip to content

基于 CSS unicode-range 特性,对 woff2 字体进行切片,以优化网络加载体验。

License

Notifications You must be signed in to change notification settings

TakWolf/source-han-vf-sliced

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

思源可变字体切片

基于 CSS unicode-range 特性,对 woff2 字体进行切片,以优化网络加载体验。

用法

导入 CSS 样式:

<link rel="stylesheet" href="https://source-han-vf-sliced.takwolf.com/css/index.css">

然后可以在 CSS 样式中使用:

body {
    font-family: SourceHanSans-CN, sans-serif;
}

h1 {
    font-family: SourceHanSerif-CN, serif;
}

全部字体名称如下:

字体 font-family
黑体 - 简体中文 SourceHanSans-CN
黑体 - 繁体中文 - 香港 SourceHanSans-HK
黑体 - 繁体中文 - 台湾 SourceHanSans-TW
黑体 - 日语 SourceHanSans-JP
黑体 - 韩语 SourceHanSans-KR
宋体 - 简体中文 SourceHanSerif-CN
宋体 - 繁体中文 - 香港 SourceHanSerif-HK
宋体 - 繁体中文 - 台湾 SourceHanSerif-TW
宋体 - 日语 SourceHanSerif-JP
宋体 - 韩语 SourceHanSerif-KR

本地构建

执行 python -m tools.build 命令来开始构建。

生成的文件位于 www 目录。

字体版本

程序依赖

参考资料

许可证

基于 MIT 许可证

About

基于 CSS unicode-range 特性,对 woff2 字体进行切片,以优化网络加载体验。

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published