← 返回
AI智能 中文

Google Fonts

Load Google Fonts with proper performance, subsetting, and proven font pairings.
在加载 Google Fonts 时注重性能、子集化及可靠的字体搭配。
ivangdavila
AI智能 clawhub v1.0.0 1 版本 99744.5 Key: 无需
★ 2
Stars
📥 1,131
下载
💾 43
安装
1
版本
#latest

概述

Loading Mistakes

  • Missing display=swap causes invisible text until font loads—always add it to URL
  • Load only weights you use: wght@400;600;700 not the entire family—each unused weight wastes ~20KB
  • Missing preconnect slows load—add both: and

Variable Fonts

  • Inter, Roboto Flex, Montserrat, Open Sans have variable versions—one file for all weights
  • Use wght@100..900 syntax for variable—downloads single file instead of multiple
  • CSS for variable: font-weight: 450 works with any value in range
  • Check "Variable" badge on font page—not all Google Fonts are variable

Subsetting

  • Default includes latin—only add &subset=latin-ext if you need Polish, Vietnamese, etc.
  • CJK fonts (Noto Sans JP, etc.) are huge—Google serves them sliced, but still heavy
  • Unused subsets = wasted bytes—check what characters you actually need

Proven Pairings

Serif + Sans-Serif (classic contrast):

  • Playfair Display (heading) + Source Sans Pro (body)
  • Lora (heading) + Roboto (body)
  • Libre Baskerville (heading) + Montserrat (body)
  • Merriweather (heading) + Open Sans (body)

Sans-Serif only (modern/clean):

  • Inter (both)—vary weight for hierarchy
  • Montserrat (heading) + Hind (body)
  • Poppins (heading) + Nunito (body)
  • Work Sans (heading) + Open Sans (body)

Tech/Startup:

  • Space Grotesk (heading) + Space Mono (code)
  • DM Sans (heading) + DM Mono (code)
  • IBM Plex Sans + IBM Plex Mono

Display fonts (headings only):

  • Abril Fatface, Bebas Neue, Oswald—never use these for body text

Font Selection by Purpose

  • Long-form reading: Merriweather, Lora, Source Serif Pro, Crimson Text
  • UI/Interfaces: Inter, Roboto, Open Sans, Nunito Sans (tall x-height, clear at small sizes)
  • Impact headings: Playfair Display, Oswald, Bebas Neue (not for body)
  • Monospace: JetBrains Mono, Fira Code, Source Code Pro

Common Mistakes

  • Loading 6+ weights "to be safe"—pick exactly the weights you use (usually 2-3)
  • Using display fonts for paragraphs—Lobster, Pacifico, Abril Fatface are heading-only
  • Two fonts too similar—Roboto + Open Sans look almost identical; just use one
  • Missing font-weight in CSS—font-weight: 600 won't work if you only loaded 400 and 700
  • No fallback stack—always: font-family: 'Inter', system-ui, sans-serif

Self-Hosting

  • Self-host for GDPR compliance—Google Fonts loads from Google servers, logs IP addresses
  • Use google-webfonts-helper to download files
  • Same font-display: swap needed in your @font-face
  • Self-hosted can be faster if your CDN is closer than Google's

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-29 02:34 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

ai-intelligence

self-improving agent

pskoett
捕获经验教训、错误和纠正,以实现持续改进。使用时机:(1)命令或操作意外失败;(2)用户纠正……
★ 4,058 📥 796,989
ai-intelligence

Proactive Agent

halthelobster
将AI智能体从任务执行者升级为主动预判需求、持续优化的智能伙伴。集成WAL协议、工作缓冲区、自主定时任务及实战验证模式。Hal Stack核心组件 🦞
★ 834 📥 212,872
ai-intelligence

ontology

oswalpalash
类型化知识图谱,用于结构化智能体记忆与可组合技能。支持创建/查询实体(人员、项目、任务、事件、文档)及关联...
★ 710 📥 243,597