查看思源字体字形映射的便捷工具。
点此链接 在线访问。
python -m tools.build_fonts
python -m tools.build_data
为了优化网络加载体验,基于 CSS unicode-range 特性,对 woff2 字体进行切片。
导入 CSS 样式:
<link rel="stylesheet" href="https://source-han-mapping-viewer.takwolf.com/fonts/index.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 |