PHPackages                             neuralglitch/font-manager - 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. [Templating &amp; Views](/categories/templating)
4. /
5. neuralglitch/font-manager

ActiveSymfony-bundle[Templating &amp; Views](/categories/templating)

neuralglitch/font-manager
=========================

Universal font manager for Symfony supporting multiple providers (Google Fonts, Bunny Fonts, Local Fonts, Fontsource) with development CDN and production font locking

0.2.0(5mo ago)292MITPHPPHP &gt;=8.1CI passing

Since Nov 8Pushed 5mo agoCompare

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

READMEChangelog (2)Dependencies (19)Versions (4)Used By (0)

Font Manager
============

[](#font-manager)

### Universal font manager for Symfony supporting multiple providers

[](#universal-font-manager-for-symfony-supporting-multiple-providers)

[![PHP Version](https://camo.githubusercontent.com/b7305b055afbd775305e6192889d355653455a31848f6ae3446e6b5ef205659d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e312b2d3737374242343f7374796c653d666c6174266c6f676f3d706870266c6f676f436f6c6f723d7768697465)](composer.json)[![Symfony](https://camo.githubusercontent.com/e9a98c31464d231765804f4fdc323f1c325b9a442e4be9a58455e5b5537fdce5/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f53796d666f6e792d362e342b2d3334333433343f7374796c653d666c6174266c6f676f3d73796d666f6e79266c6f676f436f6c6f723d7768697465)](composer.json)
[![PHPUnit](https://github.com/neuralglitch/font-manager/actions/workflows/phpunit.yml/badge.svg)](https://github.com/neuralglitch/font-manager/actions/workflows/phpunit.yml)[![Coverage](https://github.com/neuralglitch/font-manager/actions/workflows/coverage.yml/badge.svg)](https://github.com/neuralglitch/font-manager/actions/workflows/coverage.yml)[![PHPStan](https://github.com/neuralglitch/font-manager/actions/workflows/phpstan.yml/badge.svg)](https://github.com/neuralglitch/font-manager/actions/workflows/phpstan.yml)
[![Psalm](https://github.com/neuralglitch/font-manager/actions/workflows/psalm.yml/badge.svg)](https://github.com/neuralglitch/font-manager/actions/workflows/psalm.yml)[![Infection](https://github.com/neuralglitch/font-manager/actions/workflows/infection.yml/badge.svg)](https://github.com/neuralglitch/font-manager/actions/workflows/infection.yml)[![Code Style](https://github.com/neuralglitch/font-manager/actions/workflows/php-cs-fixer.yml/badge.svg)](https://github.com/neuralglitch/font-manager/actions/workflows/php-cs-fixer.yml)
[![Release](https://camo.githubusercontent.com/0bfaaa47e8a80ad9e7173841a14f57d7a50d706daca2e2dea130914185000519/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6e657572616c676c697463682f666f6e742d6d616e616765722e7376673f7374796c653d666c6174266c6f676f3d7061636b6167697374266c6f676f436f6c6f723d7768697465)](https://packagist.org/packages/neuralglitch/font-manager)[![Downloads](https://camo.githubusercontent.com/060785f049b30f1dc40603a426665b113a4b07bcdff337441645da7c1459f901/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6e657572616c676c697463682f666f6e742d6d616e616765722e7376673f7374796c653d666c6174266c6f676f3d7061636b6167697374266c6f676f436f6c6f723d7768697465)](https://packagist.org/packages/neuralglitch/font-manager)[![License](https://camo.githubusercontent.com/f48f8d6cf609f5b181b9c3218a85175fe8a5809c7ea400347f39697a5d55065d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e7376673f7374796c653d666c6174)](LICENSE)

Features
--------

[](#features)

- **Multiple Providers** - Google Fonts, Bunny Fonts, Fontsource, and Local Fonts
- **Privacy-Friendly** - GDPR-compliant options (Bunny Fonts, Fontsource)
- **Development Mode** - CDN with inline styles
- **Production Mode** - Lock fonts locally for better performance and privacy
- **Multi-Format Export** - Export fonts in 12+ formats (CSS, SCSS, Tailwind, TypeScript, Design Tokens, and more)
- **Build Tool Support** - AssetMapper, Webpack, and Vite auto-detection
- **Framework Integration** - Bootstrap SCSS variables, Tailwind config, CSS custom properties
- **Design System Ready** - W3C Design Tokens, Figma Tokens, Style Dictionary
- **Smart CSS** - Automatic font styling for body, headings, and bold text
- **CLI Tools** - Search, lock, validate, prune, and export commands
- **Custom Fonts** - Support for self-hosted brand fonts
- **Type-Safe** - PHP 8.1 enums and TypeScript definitions

Supported Providers
-------------------

[](#supported-providers)

ProviderFontsPrivacyAPI KeyCDN**Google Fonts**1,500+⚠️ TracksOptional✅**Bunny Fonts**1,500+✅ GDPRNo✅**Fontsource**1,500+✅ GoodNo✅**Local Fonts**Custom✅ PerfectNo❌**Recommended for privacy:** Use **Bunny Fonts** (GDPR-compliant, zero tracking)

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

[](#prerequisites)

For fully automatic setup, visit the [related Flex recipe repository](https://github.com/neuralglitch/symfony-recipes) and follow the instructions to add it to the composer.json in the consuming project, as the recipe is not yet part of the Symfony’s main recipe repository.

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

[](#installation)

```
composer require neuralglitch/font-manager
```

Quick Start
-----------

[](#quick-start)

### 1. Add fonts to your template

[](#1-add-fonts-to-your-template)

```
{# templates/base.html.twig #}

  {# Use default provider (Bunny Fonts recommended for privacy) #}
  {{ font_manager('Ubuntu', '300 400 700', 'normal italic') }}

  {# Monospace font for code #}
  {{ font_manager('JetBrains Mono', '400 500', 'normal', 'swap', true) }}

```

### 2. Lock fonts for production

[](#2-lock-fonts-for-production)

```
php bin/console fonts:lock
```

This downloads fonts to `assets/fonts/` and automatically exports them in configured formats.

The bundle automatically switches to locked fonts in production.

### 3. Configure export formats (optional)

[](#3-configure-export-formats-optional)

```
# config/packages/font_manager.yaml
font_manager:
  build:
    tool: 'auto'  # auto-detect: assetmapper, webpack, or vite

  export:
    formats:
      - css_variables      # CSS custom properties
      - scss_bootstrap     # Bootstrap SCSS variables
      - tailwind_config    # Tailwind CSS configuration
      - typescript_definitions  # TypeScript type definitions
```

Available formats:

- **CSS**: `css_variables`, `css_modules`, `css_layer`
- **SCSS**: `scss_variables`, `scss_bootstrap`, `scss_mixins`
- **JavaScript**: `esm_javascript`, `tailwind_config`, `typescript_definitions`
- **Design System**: `json`, `design_tokens`, `figma_tokens`, `style_dictionary`

### 4. Optional: Search and export

[](#4-optional-search-and-export)

```
# Search available fonts (requires API key for Google provider)
php bin/console fonts:search roboto --provider=google

# Export fonts in specific formats
php bin/console fonts:export --format=scss_bootstrap --format=tailwind_config

# List all available export formats
php bin/console fonts:formats

# Show usage instructions for a format
php bin/console fonts:format:info scss_bootstrap

# Validate local fonts
php bin/console fonts:validate
```

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

[](#configuration)

```
# config/packages/font_manager.yaml
font_manager:
    default_provider: 'bunny'  # Recommended: privacy-friendly

    providers:
        bunny:
            enabled: true  # GDPR-compliant, zero tracking
```

For detailed configuration options, see [Configuration Guide](docs/configuration.md).

Migration from google-fonts
---------------------------

[](#migration-from-google-fonts)

Migrating from `neuralglitch/google-fonts`? Use the automatic migration command:

```
php bin/console fonts:migrate-from-google-fonts --dry-run  # Preview
php bin/console fonts:migrate-from-google-fonts            # Apply
```

See [Migration Guide](docs/migration.md) for details.

Multi-Format Export
-------------------

[](#multi-format-export)

Font Manager can export fonts in 12+ formats for seamless framework integration:

### Bootstrap Integration

[](#bootstrap-integration)

```
# config/packages/font_manager.yaml
font_manager:
  export:
    formats:
      - scss_bootstrap
```

```
// app.scss
@import './assets/styles/fonts-bootstrap';  // Font Manager variables
@import 'bootstrap/scss/bootstrap';         // Bootstrap uses your fonts
```

### Tailwind Integration

[](#tailwind-integration)

```
font_manager:
  export:
    formats:
      - tailwind_config
```

```
// tailwind.config.js
const fontConfig = require('./assets/fonts-tailwind.config.js');

module.exports = {
  theme: {
    extend: {
      fontFamily: fontConfig.fontFamily,
    },
  },
};
```

### TypeScript Integration

[](#typescript-integration)

```
font_manager:
  export:
    formats:
      - typescript_definitions
```

```
// app.ts
import { fonts, type FontFamily } from './assets/fonts';

function applyFont(element: HTMLElement, family: FontFamily) {
  element.style.fontFamily = fonts[family].family; // Type-safe!
}
```

Documentation
-------------

[](#documentation)

- **[Export Formats](docs/exports.md)** - Multi-format export guide (CSS, SCSS, Tailwind, TypeScript, Design Tokens)
- **[Usage Guide](docs/usage.md)** - Function parameters and examples
- **[Providers](docs/providers.md)** - Provider comparison and setup
- **[Commands](docs/commands.md)** - CLI command reference
- **[Configuration](docs/configuration.md)** - All configuration options
- **[Local Fonts](docs/local-fonts.md)** - Custom font setup
- **[Migration Guide](docs/migration.md)** - Migrating from google-fonts

Requirements
------------

[](#requirements)

- PHP 8.1 or higher
- Symfony 6.4, 7.x, or 8.x
- Twig 3.0 or higher

Support
-------

[](#support)

- [GitHub Issues](https://github.com/neuralglitch/font-manager/issues)
- [Security](https://github.com/neuralglitch/font-manager/security)
- [Contributing](CONTRIBUTING.md)

License
-------

[](#license)

[MIT](LICENSE)

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance75

Regular maintenance activity

Popularity14

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity35

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.

###  Release Activity

Cadence

Every ~13 days

Total

2

Last Release

168d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/af2b1adb15c0785db3d7bb43476f91c5f7fb105890b52e32b303f66623471931?d=identicon)[neuralglitch](/maintainers/neuralglitch)

---

Tags

bunnyfontsourcegoogle-fontslocal-fontssymfonysymfony-bundlesymfonytwigSymfony Bundletypographygoogle fontsgdprprivacyasset-mapperfontsbunny-fontslocal-fontsfontsourcefont-manager

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Psalm, Rector

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/neuralglitch-font-manager/health.svg)

```
[![Health](https://phpackages.com/badges/neuralglitch-font-manager/health.svg)](https://phpackages.com/packages/neuralglitch-font-manager)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M647](/packages/sylius-sylius)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.0k15.4k](/packages/prestashop-prestashop)[simplesamlphp/simplesamlphp

A PHP implementation of a SAML 2.0 service provider and identity provider.

1.1k12.4M191](/packages/simplesamlphp-simplesamlphp)[contao/core-bundle

Contao Open Source CMS

1231.6M2.3k](/packages/contao-core-bundle)

PHPackages © 2026

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