Skip to content

关于博客引用字体的问题 #1547

Answered by yihui
flight025 asked this question in Q&A
Discussion options

You must be logged in to vote

奥勒留大帝你好:

这个稍微有一丁点复杂。手机上通常没有楷体或思源宋体,而要是完整加载这些字体的话,会非常慢,因为完整的中文字体文件通常都非常大,不适合作为网络资源加载。我的办法是提取了字体的子集、保存到我的一个 Github 库中,然后通过 jsdelivr 的 CDN 加载:

@font-face {
font-family: 'Source Han Serif CN';
src: local('Source Han Serif CN'), local('Source Han Serif SC'),
local('Source Han Serif TC'), local('Source Han Serif TW'),
local('Source Han Serif'), local('Noto Serif CJK SC'), local('Songti SC'), local('SimSong'),
url('https://cdn.jsdelivr.net/gh/yihui/cron/fonts/SourceHanSerifCN-Regular-yihui.woff2') format('woff2');
}
@font-face {
font-family: 'FandolKai';
src: local('Kaiti'), local('Kai…

Replies: 3 comments 9 replies

Comment options

You must be logged in to vote
6 replies
@yihui
Comment options

@flight025
Comment options

@flight025
Comment options

@yihui
Comment options

@flight025
Comment options

Answer selected by yihui
Comment options

You must be logged in to vote
2 replies
@yihui
Comment options

@residualsun1
Comment options

Comment options

You must be logged in to vote
1 reply
@yihui
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants
Converted from issue

This discussion was converted from issue #1546 on December 10, 2023 02:33.