🔤 Typography Scale Generator
📐 工作原理與說明
字號 size(n) = base × rⁿ(r 為模數比,如 1.25 為大三度、1.618 為黃金比)
基於模數化排版比例:以基準字號按比例派生標題到正文的字號階梯,輸出字號表與 CSS,用於建立一致的排版層級。
Build a font-size ladder from a ratio such as 1.25 and export a heading-to-body scale table and CSS for a consistent hierarchy.
匯出的 CSS 會寫入所選字型;目標裝置需安裝該字型,否則使用字型棧中的回退字型。
📚 深度解析:字型比例尺
💡 常見使用場景
- 統一標題層級。
- 設計系統字號。
- 排版規範。
生成 1.25 比例
輸入:基 16px、比 1.25、6 檔。
處理:以正文為基準遞推字號,並生成 body、h1–h5、展示級類規則。
輸出:--body-size…、--display-size 等變數與可直接套用的 CSS;字型選擇寫入 --font-family。
❓ 常見問題(FAQ)
- 比例選多大?
- 1.2 緊湊、1.25 通用、1.333 舒展;按氣質選。
- 基字號怎麼定?
- 正文通常 16px 起;過小傷可讀,按受眾與裝置調整。
- 會儲存或上傳我的內容嗎?
- 結果以瀏覽器即時計算為準,純前端本地處理、資料不上傳;生成的樣式與程式碼僅作快速產出參考,正式專案請以設計系統、規範與瀏覽器實測為準。
Formula & Standard References
| Item | Formula / Note | Source / Standard |
|---|---|---|
| Modular ratio | each step multiplies the previous size by a fixed ratio | Modular scale convention |
| Line height coupling | smaller sizes need larger relative leading, often 1.4 to 1.6 | Bringhurst, The Elements of Typographic Style |
| Step legibility | steps below a 1.2 ratio are hard to tell apart | Modular scale convention |
⚠️ 使用說明與注意事項
- 本工具純前端執行,資料不會上傳到伺服器
- 建議在主流瀏覽器(Chrome/Safari/Firefox/Edge)中使用
- 計算結果僅供參考,請以實際應用場景為準