转载
这位老哥
/
fonts.css 的项目。
相关链接:
这个的主要作用是在项目中引入 fonts.css 之后,在 html 标签中直接使用类似于 font-kai class 属性,该 div 的字体就是楷体
<
div
class=
"font-kai"
>
感谢您的协助!
</
div
>
其实都是系统自带的,现在可以跨了平台不用自己兼容了
Fonts.css -- 跨平台中文字体解决方案
Note: 下滑线标注的为本地存在的字体,关于测试字体的方法,可以看我
这个 Repo
- Windows
- Mac
- Linux
黑体
24px
我能吞下玻璃而不伤身体,The quick brown fox jumps over the lazy dog.
18px
我能吞下玻璃而不伤身体,The quick brown fox jumps over the lazy dog.
16px
我能吞下玻璃而不伤身体,The quick brown fox jumps over the lazy dog.
14px
我能吞下玻璃而不伤身体,The quick brown fox jumps over the lazy dog.
12px
我能吞下玻璃而不伤身体,The quick brown fox jumps over the lazy dog.
.font-hei
Apple System
,
Helvetica Neue
,
Helvetica
,
Nimbus Sans L
,
Arial
,
Liberation Sans
,
PingFang
,
冬青黑
,
思源黑体
,
微软雅黑
,
文泉驿微米黑
,
文泉驿正黑
,
华文黑体
,
中易黑体
,
文泉驿点阵正黑
font-family: -apple-system, "Helvetica Neue", Helvetica, "Nimbus Sans L", Arial, "Liberation Sans", "PingFang SC", "Hiragino Sans GB", "Source Han Sans CN", "Source Han Sans SC", "Microsoft YaHei", "Wenquanyi Micro Hei", "WenQuanYi Zen Hei", "ST Heiti", SimHei, "WenQuanYi Zen Hei Sharp", sans-serif;
- >Use apple system font (like San Francisco) by default, see also: https://github.com/zenozeng/fonts.css/issues/29
- >某些 Linux 中 Helvetica 会自动 fallback 到 Nimbus Sans L (具体见 /etc/fonts/conf.d/30-metric-aliases.conf, debian jessie/sid )
- >某些 Linux 中 Arial 会自动 fallback 到 Liberation Sans (具体见 /etc/fonts/conf.d/30-metric-aliases.conf, debian jessie/sid )
- Windows
- Mac
- Linux
楷体
24px
我能吞下玻璃而不伤身体,The quick brown fox jumps over the lazy dog.
18px
我能吞下玻璃而不伤身体,The quick brown fox jumps over the lazy dog.
16px
我能吞下玻璃而不伤身体,The quick brown fox jumps over the lazy dog.
14px
我能吞下玻璃而不伤身体,The quick brown fox jumps over the lazy dog.
12px
我能吞下玻璃而不伤身体,The quick brown fox jumps over the lazy dog.
.font-kai
Baskerville
,
Georgia
,
Liberation Serif
,
Kaiti SC
,
华文楷体
,
AR PL UKai
,
文鼎PL简中楷
,
楷体
,
標楷體
,
全字库正楷体
font-family: Baskerville, Georgia, "Liberation Serif", "Kaiti SC", STKaiti, "AR PL UKai CN", "AR PL UKai HK", "AR PL UKai TW", "AR PL UKai TW MBE", "AR PL KaitiM GB", KaiTi, KaiTi_GB2312, DFKai-SB, "TW\-Kai", serif;
- Windows
- Mac
- Linux
宋体
24px
我能吞下玻璃而不伤身体,The quick brown fox jumps over the lazy dog.
18px
我能吞下玻璃而不伤身体,The quick brown fox jumps over the lazy dog.
16px
我能吞下玻璃而不伤身体,The quick brown fox jumps over the lazy dog.
14px
我能吞下玻璃而不伤身体,The quick brown fox jumps over the lazy dog.
12px
我能吞下玻璃而不伤身体,The quick brown fox jumps over the lazy dog.
.font-song
Georgia
,
Nimbus Roman No9
,
Songti SC
,
华文宋体
,
AR PL New Sung
,
文鼎PL简报宋
,
新宋体
,
中易宋体
,
全字库正宋体
,
文泉驿点阵宋
,
AR PL UMing
,
新细明体
,
细明体
font-family: Georgia, "Nimbus Roman No9 L", "Songti SC", STSong, "AR PL New Sung", "AR PL SungtiL GB", NSimSun, SimSun, "TW\-Sung", "WenQuanYi Bitmap Song", "AR PL UMing CN", "AR PL UMing HK", "AR PL UMing TW", "AR PL UMing TW MBE", PMingLiU, MingLiU, serif;
- Windows
- Mac
仿宋
24px
我能吞下玻璃而不伤身体,The quick brown fox jumps over the lazy dog.
18px
我能吞下玻璃而不伤身体,The quick brown fox jumps over the lazy dog.
16px
我能吞下玻璃而不伤身体,The quick brown fox jumps over the lazy dog.
14px
我能吞下玻璃而不伤身体,The quick brown fox jumps over the lazy dog.
12px
我能吞下玻璃而不伤身体,The quick brown fox jumps over the lazy dog.
.font-fang-song
font-family: Baskerville, "Times New Roman", "Liberation Serif", STFangsong, FangSong, FangSong_GB2312, "CWTEX\-F", serif;
- >某些 Linux 中 Times New Roman 会自动 fallback 到 Liberation Serif (具体见 /etc/fonts/conf.d/30-metric-aliases.conf, debian jessie/sid )
- >CWTEX仿宋体是繁体字型
0