PHPackages                             uxcode-fr/font-optimizer - 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. uxcode-fr/font-optimizer

ActiveLibrary

uxcode-fr/font-optimizer
========================

Automate your web typography workflow with this Composer dev-tool.

1.0.16(1mo ago)995—0%1MITPHPPHP &gt;=8.1

Since Mar 12Pushed 1mo agoCompare

[ Source](https://github.com/uxcode-fr/font-optimizer)[ Packagist](https://packagist.org/packages/uxcode-fr/font-optimizer)[ Docs](https://github.com/uxcode-fr/font-optimizer)[ RSS](/packages/uxcode-fr-font-optimizer/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (3)Versions (17)Used By (0)

Font Optimizer
==============

[](#font-optimizer)

**Automate your web typography workflow with this Composer dev-tool.**

Converts TTF fonts to optimized WOFF2 subsets using Python FontTools. Works with **Laravel**, **Symfony**, and **vanilla PHP** projects.

[![Screenshot](https://raw.githubusercontent.com/uxcode-fr/font-optimizer/main/screenshot.png)](https://raw.githubusercontent.com/uxcode-fr/font-optimizer/main/screenshot.png)
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

[](#)

Prerequisites
-------------

[](#prerequisites)

Requires **Python 3** and **FontTools** with **Brotli** support on your system.

```
# Ubuntu / Debian
sudo apt update && sudo apt install -y python3 python3-fonttools python3-brotli

# macOS
brew install python3 && pip3 install fonttools brotli
```

---

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

[](#installation)

```
composer require --dev uxcode-fr/font-optimizer
```

After installation, Composer automatically checks that Python 3 and fontTools are available:

```
✓  font-optimizer: Python3 + fontTools detected.

```

If the check fails, you will see:

```
⚠  font-optimizer requires Python3 + fontTools to work.
   Run: sudo apt install -y python3 python3-fonttools python3-brotli

```

The binary is available at `vendor/bin/font-optimizer`.

---

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

[](#configuration)

Configuration is loaded from **`config/font-optimizer.php`** if present, otherwise from the `extra` section of `composer.json`.

### Option A — `config/font-optimizer.php` (Laravel, Symfony, vanilla PHP)

[](#option-a--configfont-optimizerphp-laravel-symfony-vanilla-php)

**Laravel** — publish the default config:

```
php artisan vendor:publish --tag=font-optimizer-config
```

**Other projects** — create the file manually at the root of your project:

```
