google fonts preview
2022-12-03
一個生成Google字體的預覽圖像的腳本。
生成的預覽圖像可在“發行”部分下載。或按照下面的說明自己生成預覽圖像。

克隆此存儲庫並運行以下命令:
# 1. Install dependencies
npm install
# 2. Run the script to generate the preview images
npm run generate這將獲取所有字體並為所有字體生成預覽圖像。這將需要一段時間(我的機器上約25分鐘)。圖像將保存在/output/previews目錄中。
您需要安裝node.js v16或更新。
您可以通過編輯config.json文件來自定義預覽:
{
// Text of the preview images.
// If empty, the font name will be used.
previewText : "" ,
// The text color of the preview text.
textColor : "#1b1b18" ,
// The font size of the preview text.
// Has to be a valid CSS font-size value.
fontSize : "48px" ,
// The format and file extension of the preview images.
// Either "png" or "jpeg".
format : "png" ,
// The quality of the preview images (only used for JPEG).
quality : 100 ,
// If the background should be transparent (only used for PNG).
transparent : true ,
} 僅包括sans-serif,serif,顯示,筆跡和單拼字體。圖標字體被排除在外。