> ### 字體安裝
1. 下載字體
2. 安裝nodeJS
3. npm配置(更改倉庫的位置)
```
npm config set registry https://registry.npm.taobao.org
```
4. 安裝font-spider
```
npm install font-spider -g
```
5. `font-spider --version`
`font-spider *.html` //壓縮字體文件
> ### 字體使用
```
.custom-font {
font-family: "IF";
font-size: 36px;
}
@font-face {
font-family: "IF";
src: url("font/cao.ttf");
}
```
```
<p class="custom-font">小米新品發布會</p>
```
> ### 注意
1. 安裝font-spider后如果終端讀取不出來需重啟
2. font-spider只壓縮需要的字體,字體更改后需重新壓縮