首先:下载自己想要引入的字体
在自己的css文件中引入
@font-face {
font-family:HarmonyOS_Sans_SC_Medium;font-style: normal;font-display: swap;
src: url('../fonts/HarmonyOS_Sans_SC_Medium.woff2') format('woff2'),
url('../fonts/HarmonyOS_Sans_SC_Medium.woff') format('woff');
}
*{font-family:HarmonyOS_Sans_SC_Medium;}
最终的效果
我这用的是鸿蒙字体