一、全新 HarmonyOS 字体

鸿蒙字体(HarmonyOS Sans)是华为最新发布的鸿蒙操作系统HarmonyOS的自带字体,随系统一起开源,以HarmonyOS Sans Fonts License Agreement协议授权发布,您可以免费用于个人及商业用途。

通过研究用户在不同场景下对多终端设备的阅读反馈,综合考量不同设备的尺寸、使用场景等因素,同时也考虑用户使用设备时因视距、视角的差异带来的字体大小和字重的不同诉求,华为为 HarmonyOS 设计了全新系统默认的字体——HarmonyOS Sans。

二、电脑安装HarmonyOS Sans SC

1.HarmonyOS官方字体下载

https://developer.harmonyos.com/cn/docs/design/des-guides/font-0000001157868583

2.字体设置软件(用软件将 HarmonyOS Sans SC 全部应用)

https://wwm.lanzoul.com/ixsTL01qhxle

三、博客主题添加鸿蒙字体 HarmonyOS

1.header.php 添加

<link rel="stylesheet" href="https://blog.luoli.net/font/ziti.css" media="all" onload="this.media='all'" />

2.style.css 写入

body {
  /* Screen version */
  font-family: "HarmonyOS_Regular","HarmonyOS_Medium",sans-serif;
}

四、特别说明

linux服务器网站调用字体文件存本地服务器时,需要修改nginx配置,代码加到配置里即可

location ~* .(eot|otf|ttf|woff|woff2|svg)$ {
add_header Access-Control-Allow-Origin * always;}