PHPackages                             straylightagency/fonts - 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. straylightagency/fonts

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

straylightagency/fonts
======================

Helper to rend HTML tags to load fonts from services like Google Fonts, Adobe Fonts and Fontawesome

05PHP

Since Dec 31Pushed 4mo agoCompare

[ Source](https://github.com/straylightagency/php-fonts)[ Packagist](https://packagist.org/packages/straylightagency/fonts)[ RSS](/packages/straylightagency-fonts/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

PHP Fonts Manager
=================

[](#php-fonts-manager)

Helper to rendering HTML tags to load fonts from services like Google Fonts, Bunny Fonts, Adobe Fonts or FontAwesome.

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

[](#installation)

Require this package with composer.

```
composer require straylightagency/fonts
```

### Laravel without auto-discovery:

[](#laravel-without-auto-discovery)

If you do not use auto-discovery, add the ServiceProvider to the providers array in `bootstrap/providers.php` :

```
Straylightagency\Fonts\Laravel\FontsServiceProvider::class,
```

Then add this line to your facades in `config/app.php` :

```
'Fonts' => Straylightagency\Fonts\Laravel\Fonts::class,
```

Usage
-----

[](#usage)

### Without Laravel

[](#without-laravel)

This package can be used without Laravel. Just instantiate the `FontsManager` class as a regular object.

```
use Straylightagency\Fonts\FontsManager;

$fontsManager = new FontsManager;
```

You can inject the object in your favorite dependency container.

### With Laravel

[](#with-laravel)

The package provides by default a Facade for Laravel application. You can call methods directly using the Facade or use the alias instead.

Print the tags based on the fonts you need through a driver :

```
@php
    use Straylightagency\Fonts\Laravel\Fonts;

    Fonts::googleV2('Oswald', ['300', '400'])
         ->googleV2('Open Sans', ['300..800'])
         ->googleV2('Chakra Petch', 'ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500;1,600;1,700')
         ->fontawesome('12b534g387')
         ->print();
@endphp

```

API Documentation
-----------------

[](#api-documentation)

Examples bellow are using Laravel Facade `Fonts`. The facade directly call the `FontsManager` class.

Define the driver to use by default when the method `load` is called.

```
FontsManager::setDefault(driver_name: string);
```

Add a new driver into the `FontsManager`. `$closure` must return an instance of the driver that extend the `Driver` class.

```
FontsManager::withDriver(driver_name: string, closure: Closure);
```

Get a driver by his name. If the driver has not already been instantiated, make a new instance.

```
FontsManager::use(driver_name: string);
```

Load a font using the default driver that was set using `setDefault` method. By default, it's the `GoogleV2Driver`.

```
FontsManager::load(font_name: string, font_weights: string|array = [ Fonts::regular ]);
```

Load a font using the Google Fonts driver

```
FontsManager::google(font_name: string, font_weights: string|array = [ Fonts::regular ]);
```

Load a font using the Google Fonts V2 driver

```
FontsManager::googleV2(font_name: string, font_weights: string|array = [ Fonts::regular ]);
```

Load a font using the BunnyFonts driver

```
FontsManager::bunny(font_name: string, font_weights: string|array = [ Fonts::regular ]);
```

Load a fonts kit from Adobe Fonts

```
FontsManager::adobe(kit_id: string);
```

Load an icons kit using the FontAwesome driver

```
FontsManager::fontawesome(kit_id: string);
```

Generate an HTML code of every driver instantiated with at least 1 font set.

```
$html = FontsManager::toHtml();
```

Print the code generated by the method `toHtml`

```
FontsManager::print();
```

Requirement
-----------

[](#requirement)

PHP 8.3 or above

See also
--------

[](#see-also)

- [Google Fonts](https://fonts.google.com/)
- [Bunny Fonts](https://fonts.bunny.net/)
- [Adobe Fonts](https://fonts.adobe.com/)
- [FontAwesome](https://fontawesome.com/)

Credits
-------

[](#credits)

- [Anthony Pauwels](https://github.com/anthonypauwels)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT).

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance52

Moderate activity, may be stable

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity12

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

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/6efc7b890c1ad6bb8e50736509128ada317f6501785de74d6edc409bc4a80550?d=identicon)[anthonypauwels](/maintainers/anthonypauwels)

---

Top Contributors

[![anthonypauwels](https://avatars.githubusercontent.com/u/4163238?v=4)](https://github.com/anthonypauwels "anthonypauwels (10 commits)")

### Embed Badge

![Health badge](/badges/straylightagency-fonts/health.svg)

```
[![Health](https://phpackages.com/badges/straylightagency-fonts/health.svg)](https://phpackages.com/packages/straylightagency-fonts)
```

###  Alternatives

[konnco/filament-import

241243.2k2](/packages/konnco-filament-import)

PHPackages © 2026

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