PHPackages                             mercator/wn-localfonts-plugin - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. mercator/wn-localfonts-plugin

ActiveWinter-plugin[Utility &amp; Helpers](/categories/utility)

mercator/wn-localfonts-plugin
=============================

Localize Google, Bunny, and Fontshare fonts for WinterCMS

00PHP

Since Jan 6Pushed 4mo agoCompare

[ Source](https://github.com/helmutkaufmann/wn-localfonts-plugin)[ Packagist](https://packagist.org/packages/mercator/wn-localfonts-plugin)[ RSS](/packages/mercator-wn-localfonts-plugin/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

LocalFonts for WinterCMS (v5.0)
===============================

[](#localfonts-for-wintercms-v50)

**LocalFonts** is a professional CLI utility for WinterCMS that localizes fonts from **Google Fonts**, **Bunny Fonts**, and **Fontshare**. It surgically extracts font assets, generates a `manifest.json` for version tracking, and builds a `fonts.less` file for immediate integration with your theme.

Key Features
------------

[](#key-features)

- **Multi-Source Discovery**: Automatically falls back from Google to Bunny to Fontshare.
- **Regex Isolation**: Critical logic is protected within the `BaseCommand` to prevent syntax errors.
- **Smart Filtering**: Automatically bypasses subset filters if the provider labels a block with the font name (common for Fontshare/Satoshi).
- **Variable Font Support**: Downloads both individual "Static" weights and modern "Variable" font files.
- **Surgical Removal**: Intelligent file cleanup that only deletes assets when no other variants reference them.

---

Installation
------------

[](#installation)

### Via Composer

[](#via-composer)

Add the repository to your root `composer.json` and install:

```
composer require mercator/wn-localfonts-plugin
```

### Manual Installation

[](#manual-installation)

1. Create: `plugins/mercator/localfonts`
2. Place the plugin files in their respective folders.
3. Register the commands:

```
php artisan plugin:refresh Mercator.LocalFonts
```

---

Configuration
-------------

[](#configuration)

Control font character sets via your root `.env` file.

SettingEnvironment VariableDefaultDescription**Subsets**`LOCALFONTS_SUBSETS``latin`Comma-separated list (e.g., `latin,latin-ext`). Set to empty to fetch all.---

Usage
-----

[](#usage)

### 1. Add a Font (`localfonts:add`)

[](#1-add-a-font-localfontsadd)

Search and localize a font family.

```
# Add standard weight
php artisan localfonts:add Satoshi

# Add full family (All weights + Italics + Variable blocks)
php artisan localfonts:add Satoshi --full
```

### 2. List Fonts (`localfonts:list`)

[](#2-list-fonts-localfontslist)

View managed fonts. You can filter by family to see specific variants.

```
# List all
php artisan localfonts:list

# Filter by family
php artisan localfonts:list Satoshi
```

### 3. Remove Fonts (`localfonts:remove`)

[](#3-remove-fonts-localfontsremove)

Surgically clean up your font directory.

```
# Remove only the large Variable files to save space
php artisan localfonts:remove Satoshi --variable

# Remove only Static weights (keeping the Variable file)
php artisan localfonts:remove Satoshi --static

# Remove everything for a family without confirmation
php artisan localfonts:remove Satoshi --force
```

---

Theme Integration
-----------------

[](#theme-integration)

Include the generated `fonts.less` (default: `assets/src/fonts/fonts.less`) into your main theme file.

### UIkit Variable Mapping

[](#uikit-variable-mapping)

We recommend using a mixin to map the specific localized IDs:

```
@import "../src/fonts/fonts.less";

// Mixin for surgical weight control
.font-variant(@family; @weight; @style: normal) {
    font-family: @family;
    font-weight: @weight;
    font-style: @style;
}

h1 { .font-variant('Satoshi', 700); }
```

---

### Pro-Tip: Browser Auditing

[](#pro-tip-browser-auditing)

If you aren't sure whether to keep the **Static** or **Variable** files, you can use the **Chrome DevTools Coverage Tab** to see exactly which font files are being utilized by your page.

1. Open **DevTools** (`Cmd+Shift+P` or `Ctrl+Shift+P`).
2. Type **"Coverage"** and select **Show Coverage**.
3. Click the **Reload** icon.
4. If a 200kb Variable font is 90% "red" (unused), you should switch to the 20kb Static files using `localfonts:remove Satoshi --variable`.

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance52

Moderate activity, may be stable

Popularity0

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity12

Early-stage or recently created project

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/2d4325040b5bcb235cf0f7555ec5b28498935f54c74bb90c3b2828461598500d?d=identicon)[mercator](/maintainers/mercator)

### Embed Badge

![Health badge](/badges/mercator-wn-localfonts-plugin/health.svg)

```
[![Health](https://phpackages.com/badges/mercator-wn-localfonts-plugin/health.svg)](https://phpackages.com/packages/mercator-wn-localfonts-plugin)
```

###  Alternatives

[felixnagel/t3extblog

A record based blog extension for TYPO3 CMS. Easy to use and packed with features (incl. comments, subscriptions for comments and posts, Wordpress like subscription manager, reasonable email sending in FE and BE, GDPR ready, BE modules, Dashboard widgets, RSS, Sitemap, ...). Flexible and powerful!

3421.6k](/packages/felixnagel-t3extblog)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
