要令到網站體驗去到唔同 Browser 都差唔多的話,咁用 Web font 就一定係個唔少得的步驟。
咁當中最簡單易用就係用 Google web font,一來唔洗錢,二來大家都用佢的話就可能已經有 Proxy 幫你 Cache 左,咁 Client Side 就唔洗再重新載入了。
### 用法
首先去呢度選返個你鍾意既字形先 : https://fonts.google.com/?noto.query=noto+
而我見到有 `Noto Sans Hong Kong` 用,咁就當然係諗都唔法諗就用呢個啦。
然後 embed 下面個 css 入去你個 template file 度。
```html
<link rel='preconnect' href='https://fonts.googleapis.com' />
<link rel='preconnect' href='https://fonts.gstatic.com' crossorigin='' />
<link href='https://fonts.googleapis.com/css2?family=Berkshire+Swash&family=Noto+Sans+HK:wght@100..900&family=Noto+Serif:ital,wght@0,100..900;1,100..900&display=swap' rel='stylesheet' />
```
再係 `style` 入面設定返字形套用的地方 :
```css
html, body, div, p, table, th, td {
font-family: 'Noto Sans HK', sans-serif;
font-optical-sizing: auto;
font-style: normal;
}
```
咁就設定好了,再 Reload 一下你個網站,當堂唔同晒 !