Windows XP Windows 7 Windows 2003 Windows Vista Windows 綜合教學 Linux 系統教學
Windows 10 Windows 8 Windows 2008 Windows NT Windows Server 電腦軟體教學
您现在的位置: Windows教程網 >> Windows教程 >  >> Linux 系統教學 >> 關於 Linux

Linux 下優化 Chrome 字體渲染:Fontconfig 微調 + Stylish 強制指定字體

編輯:關於 Linux

Linux 字體渲染品質遠優於 Windows,但 Chrome 預設讀取系統 Fontconfig 設定,若缺乏全域 Hinting 關閉規則,中文會以「完全微調」模式渲染導致筆畫粗糙。本文提供系統級與瀏覽器級雙層優化方案。

Chrome 字體渲染優化前後

系統級:關閉 Fontconfig Hinting

建立 /etc/fonts/local.conf (需 root):「

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
  <match target="font">
    <edit name="autohint" mode="assign"><bool>false</bool></edit>
    <edit name="hinting" mode="assign"><bool>false</bool></edit>
    <edit name="hintstyle" mode="assign"><const>none</const></edit>
  </match>
</fontconfig>

儲存後所有 GTK/Qt 程式即遵循此設定,中文渲染瞬間變清晰。

瀏覽器級:Stylish 強制網頁字體

  1. 安裝 Stylish (或 Stylus) 擴充功能。
  2. 新增樣式,適用範圍選 全部網站,內容:
body * {
    font-family: "Source Han Sans CN" !important;
}
pre, code, kbd, samp, var {
    font-family: "Monospace", "Source Han Sans CN" !important;
}

此規則強制所有網頁使用思源黑體 (或你偏好的字體),覆寫網站原生 CSS。

驗證方式

進入 chrome://flags/#enable-font-cache-scaling 確認無衝突旗標;用開發者工具 F12 → Computed 面板檢查實際使用字體。

雙層優化後,Chrome 中文渲染將呈現鋒利、筆畫均勻的專業級效果。

Copyright © Windows教程網 All Rights Reserved