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 字體設定無效:啟用舊版設定頁或透過語言選單修改

編輯:Linux 教學

Ubuntu/CentOS 下 Chrome 預設字體常為楷體/宋體,且在新版設定頁 (chrome://settings/fonts) 修改字體無效。本文提供兩種解決方案。

現象

  • 設定頁選擇「微軟雅黑」等字體,網頁仍顯示預設字體
  • 新版設定頁 (chrome://settings/fonts) 字體選項無反應

方案一:啟用舊版設定頁 (適用舊版 Chrome)

  1. 找到 Chrome 啟動器 (.desktop 檔或選單捷徑)
  2. 編輯啟動參數,在命令後加入 --disable-tabbed-options
    /opt/google/chrome/google-chrome --disable-tabbed-options
  3. 重啟 Chrome,進入設定 → 顯示舊版分頁式設定頁
  4. 在「網頁內容」→「自訂字體」中設定襯線/無襯線/等寬字體

方案二:透過語言/拼寫檢查選單 (適用新版 Chrome,無需重啟)

  1. 任意網頁搜尋框右鍵 → 「拼寫檢查選項」→ 「語言設定」
  2. 或直接進入 chrome://settings/languages
  3. 展開「字體編碼器」區塊
  4. 分別設定「標準字體」、「襯線字體」、「無襯線字體」、「等寬字體」
  5. 立即生效,無需重啟瀏覽器

方案三:強制字體 CSS (終極解法)

安裝擴充功能 Stylus 或 Stylebot,套用全域樣式:

@font-face {
    font-family: 'ForceSans';
    src: local('Microsoft YaHei'), local('PingFang SC'), local('Noto Sans CJK SC');
}
* {
    font-family: 'ForceSans' !important;
}

字體安裝建議

# Ubuntu/Debian
apt install -y fonts-noto-cjk fonts-wqy-zenhei fonts-wqy-microhei

# CentOS/RHEL
yum install -y google-noto-sans-cjk-fonts wqy-zenhei-fonts wqy-microhei-fonts

# 手動安裝微軟雅黑 (需授權)
mkdir -p ~/.local/share/fonts
cp msyh.ttc ~/.local/share/fonts/
fc-cache -fv

根因分析

  • Chrome 新版設定頁字體選項對 Linux 字體解析有 Bug
  • 語言設定頁直接呼叫 FontConfig 系統字體匹配,相容性較好
  • Linux 字體回退機制依賴 fontconfig 設定 (/etc/fonts/conf.d/)

若方案二無效,檢查 fc-list :lang=zh 確認系統已安裝中文字體,並以 fc-match sans 驗證預設無襯線字體匹配結果。

Copyright © Windows教程網 All Rights Reserved