字體是網頁設計的靈魂。從系統字體堆疊的零載入優勢,到 Web Fonts 的品牌表達,再到可變字體的單一檔案多重樣式,本文匯總 200+ 字體名稱清單、載入最佳化策略、中文授權陷阱與 Core Web Vitals 效能調校,為您打造專業級字體工程指南。
注意: 僅列出名稱供 font-family 堆疊參考,不代表用戶裝置皆安裝。實際可用性請參考「系統字體堆疊策略」。
/* 繁體中文 */
@font-face { font-family: "PingFang TC"; src: local("PingFang TC"); } /* macOS/iOS */
@font-face { font-family: "Microsoft JhengHei"; src: local("Microsoft JhengHei"); } /* Windows */
@font-face { font-family: "Noto Sans TC"; src: local("Noto Sans TC"); } /* Android/跨平台開源 */
/* 簡體中文 */
@font-face { font-family: "PingFang SC"; src: local("PingFang SC"); }
@font-face { font-family: "Microsoft YaHei"; src: local("Microsoft YaHei"); }
@font-face { font-family: "Noto Sans SC"; src: local("Noto Sans SC"); }
/* 日文 */
@font-face { font-family: "Hiragino Kaku Gothic ProN"; src: local("Hiragino Kaku Gothic ProN"); }
@font-face { font-family: "Yu Gothic"; src: local("Yu Gothic"); }
@font-face { font-family: "Noto Sans JP"; src: local("Noto Sans JP"); }
/* 韓文 */
@font-face { font-family: "Apple SD Gothic Neo"; src: local("Apple SD Gothic Neo"); }
@font-face { font-family: "Malgun Gothic"; src: local("Malgun Gothic"); }
@font-face { font-family: "Noto Sans KR"; src: local("Noto Sans KR"); }
/* 港澳常用 */
@font-face { font-family: "Heiti TC"; src: local("Heiti TC"); }
@font-face { font-family: "STHeiti"; src: local("STHeiti"); }
| 無襯線 | 襯線 | 等寬 | 手寫/裝飾 |
|---|---|---|---|
| Inter (開源推薦) | Georgia | JetBrains Mono | Brush Script MT |
| Roboto (Android) | Times New Roman | Fira Code (程式碼) | Comic Sans MS |
| Helvetica Neue (Mac) | Merriweather | Source Code Pro | Pacifico |
| San Francisco (Apple) | Playfair Display | Monospace | Dancing Script |
| Segoe UI (Windows) | Source Serif Pro | Ubuntu Mono | Lobster |
| Open Sans | Crimson Text | Inconsolata | Amatic SC |
| Lato | Libre Baskerville | Space Mono | Indie Flower |
| Montserrat | PT Serif | Hack | Permanent Marker |
| Source Sans Pro | Vollkorn | Cascadia Code | Shadows Into Light |
| Nunito | Spectral | IBM Plex Mono | Kaushan Script |
| Poppins | Literata | Victor Mono | Architects Daughter |
以下為 Windows/macOS 內建字體名稱,可直接用於 font-family 堆疊 (需用引號包含含空格名稱)
/* Windows 內建 (部分) */ @Arial, @Arial Black, @Arial Narrow, @Arial Rounded MT Bold, @Arial Unicode MS, @Calibri, @Cambria, @Candara, @Consolas, @Constantia, @Corbel, @Courier New, @Franklin Gothic Medium, @Georgia, @Impact, @Lucida Console, @Lucida Sans Unicode, @Malgun Gothic, @Meiryo, @Microsoft JhengHei, @Microsoft YaHei, @MingLiU, @PMingLiU, @SimSun, @NSimSun, @KaiTi, @FangSong, @SimHei, @Tahoma, @Times New Roman, @Trebuchet MS, @Verdana, @Webdings, @Wingdings; /* macOS 內建 (部分) */ @Helvetica, @Helvetica Neue, @San Francisco, @SF Pro, @SF Mono, @PingFang TC, @PingFang SC, @PingFang HK, @Hiragino Sans, @Hiragino Kaku Gothic ProN, @Apple SD Gothic Neo, @Menlo, @Monaco, @Optima, @Palatino, @Arial Unicode MS, @Times, @Courier, @Georgia, @Verdana; /* 開源跨平台 (需自行 @font-face 載入) */ @Inter, @Roboto, @Noto Sans, @Noto Sans TC/SC/JP/KR, @Source Sans Pro, @Source Serif Pro, @Source Code Pro, @JetBrains Mono, @Fira Code, @Fira Sans, @IBM Plex Sans, @Outfit, @Plus Jakarta Sans, @Space Grotesk, @DM Sans
/***** 通用無襯線堆疊 (GitHub/WordPress/Gov.uk 採用) *****/ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; /***** 繁體中文優先堆疊 *****/ font-family: "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; /***** 等寬堆疊 (程式碼區塊) *****/ font-family: "SF Mono", "Fira Code", "Fira Mono", "Menlo", "Consolas", "Liberation Mono", "Monospace";
@font-face {
font-family: 'BrandFont';
src: url('/fonts/brandfont.woff2') format('woff2'),
url('/fonts/brandfont.woff') format('woff');
font-display: swap; /* 關鍵:避免 FOIT */
font-weight: 400 700; /* 可變字體範圍 */
font-stretch: 75% 125%; /* 可變字體寬度範圍 */
unicode-range: U+0000-00FF, U+4E00-9FFF, U+3040-309F, U+30A0-30FF, U+AC00-D7AF;
}
| 值 | 封鎖期 | 交換期 | 推薦場景 |
|---|---|---|---|
| swap | 0ms | 無限 | 主體文字、品牌字體 (預設推薦) |
| fallback | 100ms | 3s | 次要文字、圖示字體 |
| optional | 100ms | 無 | 裝飾性字體、圖示字體、非關鍵 |
| block | 無限 | 無限 | 極少用,Logo/標語必須顯示正確字體 |
<head>
<link rel="preload" as="font" type="font/woff2"
href="/fonts/brandfont-regular.woff2" crossorigin>
<link rel="preload" as="font" type="font/woff2"
href="/fonts/brandfont-bold.woff2" crossorigin>
</head>
@font-face {
font-family: 'InterVariable';
src: url('/fonts/Inter-Variable.woff2') format('woff2-variations');
font-weight: 100 900;
font-stretch: 75% 125%;
font-display: swap;
}
/* CSS 註冊自訂軸線 (CSS Houdini) */
@property --font-weight {
syntax: '';
inherits: true;
initial-value: 400;
}
:root { --font-sans: 'InterVariable', system-ui, sans-serif; }
/* 動畫過渡字重 */
.btn {
font-weight: 400;
transition: font-weight 0.2s ease;
}
.btn:hover { font-weight: 600; }
/* 光學尺寸自動優化 (支援 optical-sizing 軸) */
body { font-optical-sizing: auto; }
| 策略 | 工具/服務 | 適用場景 | 體積減少 |
|---|---|---|---|
| 靜態子集化 | googlefonts/fontsubset, Font Splitter, Transfonter | 已知內容靜態站點 | 95%+ (30MB → 1-2MB) |
| 動態子集化 CDN | Google Fonts (支援 text= 參數), FontCDN, 自建 font-optimizer | 動態內容、多語系、大型平台 | 按需下載,首屏 < 100KB |
| Unicode-range 分段 | @font-face unicode-range | 瀏覽器原生支援,無需服務端 | 僅下載當前頁面用字區段 |
| 指標 | 檢查項目 | 優化動作 |
|---|---|---|
| LCP | 關鍵字體是否 preload?font-display: swap?檔案 < 50KB? | Preload + swap + 子集化/可變字體 |
| CLS | 備援字體度量是否匹配?是否設定 size-adjust? | @font-face size-adjust/ascent-override/descent-override |
| INP | 字體解析是否阻塞主執行緒? | font-display: optional 非關鍵字體、延遲載入裝飾字體 |
| FCP | 首屏文字是否等待字體下載? | 關鍵字體 inline base64 (極小) 或 system font stack |
字體工程已從「挑好看的字體」進化為「建立高效能、可維護、合規的字體系統」。核心原則:系統字體優先 → 開源可變字體 → 付費字體子集化 → unicode-range 分段載入 → font-display: swap → size-adjust 消除 CLS → 預載關鍵字體 → 自動化效能審計。將此流程納入專案 CI/CD,讓字體不再是效能瓶頸,而是品牌資產的加速器。