[WordPress] 外掛分享: Self-Hosted Google Fonts

首頁外掛目錄 › Self-Hosted Google Fonts
30,000+
安裝啟用
★★★★
4.8/5 分(40 則評價)
2833 天前
最後更新
問題解決
WordPress 4.0+ PHP 5.4+ v1.0.1 上架:2018-05-25

內容簡介

一個輕鬆的方法可以將所有 Google 字型自架託管,以增加隱私或遵循法律要求。

主題和外掛的作者通常不願提供自架方法,而下載和上傳所需的字型也相當繁重。

此外掛可以讓這些工作輕鬆完成。它會掃描您網站上的所有 CSS,並自動下載所需的 Google 網頁字型,並將它們託管在您的伺服器上。

它的運作方式:

將所有 Google 字型 enqueues 轉換為本地託管的 CSS 檔案。
掃描和轉換任何使用 @imports 的內部樣式標籤以使用字型。
處理所有未正確 enqueue 的本地 CSS 檔案(作者有問題?)。
在進行這些作業的同時,下載所有所需的 Google 字型到您的伺服器。

功能:

自動自架字型,輕鬆又簡便。
與所有主題和外掛兼容。
支援 IE9+ 和所有現代瀏覽器。
經過優化的代碼,性能優良。
內建快取處理。
與快取外掛和 Autoptimize 兼容。
API 和鉤子供主題和外掛作者使用。
在使用多個子集時使用 unicode-range 進行優化字型。Google 正式支援此功能,但其他字型下載解決方案並不支援。

開發者筆記

快取:失敗的最常見原因。如果您使用快取外掛,請清除快取。

它不適用於 WebFont Loader 等 JS 解決方案。如果您是開發人員,仍然可以使用此外掛的 API 擷取所需的 CSS 和檔案,以轉換您的 WebFont Loader。如果有興趣,我將在支援論壇上張貼說明。

外掛標籤

開發者團隊

⬇ 下載最新版 (v1.0.1) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「Self-Hosted Google Fonts」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

An easy way to self-host all your Google Fonts for increased Privacy or to meet a law requirement.
Theme and plugin authors are often unwilling to offer a self-hosted method and it’s quite laborious to download and upload each of the required font.
This plugin makes it all easy. It will scan all CSS on your site and automagically download and host on your server the necessary Google Web Fonts.
How it works:

Converts all Google Font enqueues to locally hosted CSS files.
Scans and converts any inline style tags using @imports for fonts.
Processes all the local CSS files that weren’t properly enqueued (bad authors?).
While doing so, downloads all the required Google Fonts to your server.

Features:

Automatic self-hosted fonts with no effort.
Compatible with all themes and plugins.
Supports IE9+ and all modern browsers.
Optimized code benchmarked for performance.
Built-in cache for processing.
Compatible with cache plugins and Autoptimize.
API and hooks for theme & plugin authors.
Uses unicode-range for optimized fonts when using multiple subsets. Google officially does this too, but other solutions for downloading fonts don’t support this.

Dev Notes
Cache: The most common reason for a failure. If you have a cache plugin, clear the caches.
It will not work with JS solutions like WebFont Loader. If you’re a developer, you can still use this plugin’s API to get the needed CSS and files to convert your WebFont Loader. I will post instructions on support forums if there’s interest.

延伸相關外掛

文章
Filter
Apply Filters
Mastodon