演示站点:yzyee.cn
1.选择字体
(推荐「汉仪文黑-75W」毕竟原里原气的 :face_with_raised_eyebrow:)
2.转换格式,bing个在线转换即可。将 otf、ttf
转换成 woff
格式。
3.将「woff格式字体文件」放置在 /usr/themes/handsome/assets/fonts
目录下,无需重命名
4.在 外观设置-开发者设置-自定义css中
添加一下代码
@font-face{font-family:HarmonyOS_Sans_SC_Medium;font-style:normal;font-display:swap; src:url(填写字体所在的位置) format('woff2')} *{font-family:HarmonyOS_Sans_SC_Medium} body {font- family: HarmonyOS!important;}
例如:
我就应该添加(以汉仪文黑-75W为演示)
@font-face{font-family:HarmonyOS_Sans_SC_Medium;font-style:normal;font-display:swap; src:url(usr/themes/handsome/assets/fonts/汉仪文黑-75W.woff) format('woff')} *{font-family:HarmonyOS_Sans_SC_Medium} body {font- family: HarmonyOS!important;}
原作者:猫不吃鱼
原文章:https://starsei.com/archives/1/