ernestdefoe/google-fonts

Use any Google Font on your Flarum 2 forum — pick a body font and a heading font from the full Google Fonts library, applied site-wide.

Maintainers

Package info

github.com/ernestdefoe/google-fonts

Type:flarum-extension

pkg:composer/ernestdefoe/google-fonts

Statistics

Installs: 114

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

0.2.3 2026-06-21 20:48 UTC

This package is auto-updated.

Last update: 2026-06-21 20:49:51 UTC


README

License Latest Stable Version

Use any Google Font on your Flarum 2 forum — or upload and self-host your own. Pick a body font and a heading font, applied site-wide, with a live preview right in the admin panel.

Features

  • 🔎 Searchable picker for a curated list of popular Google Fonts, in the admin settings — and you can type/paste any Google Font family name, even ones not in the list.
  • ⮆ïļ Upload your own font (self-hosting): upload one .woff2 per weight and the forum serves the font itself, with no call to Google. This works everywhere — including regions where Google Fonts is blocked, such as mainland China — and avoids the GDPR concern of fetching fonts from Google on every page view.
  • ✍ïļ Separate body and heading fonts, so you can pair (e.g.) Inter body text with Playfair Display headings.
  • 👀 Live preview of each font directly in the admin panel.
  • ⚡ Server-side injection into the page <head> — no flash of unstyled text, no client round-trip. The Google stylesheet is loaded non-render-blocking, so even on the Google path an unreachable Google never stalls page paint; visitors simply keep the system-font fallback.
  • ðŸŠķ No configuration files, no API key required.

Installation

composer require ernestdefoe/google-fonts

Then enable Google Fonts in your admin panel.

Usage

  1. Go to Admin → Google Fonts.
  2. Set a Body font and (optionally) a Heading font.
  3. Start typing to search, or paste an exact family name from fonts.google.com.
  4. Click Save. The fonts apply to your forum immediately.

Leave a field blank to fall back to your theme's default font.

Self-hosting a font (works where Google is blocked)

  1. Under a font, click Upload your own font.
  2. Give the font a name (this is just the family label used internally).
  3. For each weight you want (Regular, Bold, â€Ķ), pick the weight and upload a .woff2 file. A variable .woff2 covers every weight in a single file; a static file gets browser-synthesized bold for weights you don't upload.
  4. Uploads save immediately — no Save click needed for the files.

Only .woff2 is accepted (it's the smallest, universally-supported web font format). If you have a .ttf/.otf, convert it once with any free online woff2 converter. To go back to a Google font, click Use a Google font instead (this removes the uploaded files).

Updating

composer update ernestdefoe/google-fonts
php flarum cache:clear

License

MIT