PHPackages                             apsonex/font - 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. apsonex/font

ActiveLibrary

apsonex/font
============

Font

v1.0.4(11mo ago)0705↓100%1MITPHPPHP ^8.1

Since May 26Pushed 11mo agoCompare

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

READMEChangelog (5)Dependencies (4)Versions (6)Used By (1)

Font Manager PHP Package
========================

[](#font-manager-php-package)

A simple PHP package to manage and search fonts from multiple providers. Currently supports the **Bunny Fonts** provider with an easy way to list, search, and filter fonts.

Features
--------

[](#features)

- List fonts with pagination
- Search fonts by keyword
- Find fonts by key(s), family(ies), and type
- Extensible with multiple font providers

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

[](#installation)

```
composer require apsonex/font-manager
```

Usage
-----

[](#usage)

```
use Apsonex\Font\Font;

// Instantiate the font manager
$fontManager = Font::make();

// Select Bunny provider
$fontManager->bunny();

// List fonts (paginated)
$response = $fontManager->list(limit: 20, page: 1);
foreach ($response->fonts as $font) {
    echo $font->family . PHP_EOL;
}

// Search fonts by keyword
$searchResponse = $fontManager->search('abo', limit: 20, page: 1);

// Find font by a single key
$font = $fontManager->findByKey('abel');

// Find fonts by multiple keys
$response = $fontManager->findByKeys(['abel', 'abeezee'], limit: 10);

// Find fonts by family
$response = $fontManager->findByFamily('Abel', limit: 10);

// Find fonts by multiple families
$response = $fontManager->findByFamilies(['Abel', 'Aboreto'], limit: 10);

// Find fonts by type (e.g., 'sans-serif')
// Use limit -1 to fetch all matches
$response = $fontManager->findByType('sans-serif', limit: -1);
```

API Reference
-------------

[](#api-reference)

### Font Manager `(Apsonex\Font\Font)`

[](#font-manager-apsonexfontfont)

- make(): static — Create a new instance
- bunny(): static — Use Bunny font provider
- useProvider(FontProviderInterface $provider): static — Use a custom font provider
- list(int $limit = 20, int $page = 1): FontResponse — List fonts paginated
- search(string $keyword, int $limit = 20, int $page = 1): FontResponse — Search fonts by keyword
- findByKey(string $key): ?FontDTO — Find a single font by key
- findByKeys(array $keys, int $limit = 20): FontResponse — Find fonts by keys
- findByFamily(string $family, int $limit = 20): FontResponse — Find fonts by family
- findByFamilies(array $families, int $limit = 20): FontResponse — Find fonts by families
- findByType(string $type, int $limit = -1): FontResponse — Find fonts by category/type

### FontDTO `(Apsonex\Font\FontDTO)`

[](#fontdto-apsonexfontfontdto)

- Represents a single font object with these properties:
- key (string): Unique font key
- provider (string): Provider name
- category (string): Font category (e.g., sans-serif)
- family (string): Font family name
- urlString (string): CSS font string identifier

The `FontDTO` class represents a single font item with key metadata used across the package.

PropertyTypeDescriptionExample`key`stringUnique identifier for the font`"abeezee"``provider`stringThe font provider source`"bunny"``category`stringFont category/type (e.g., serif, sans-serif)`"sans-serif"``family`stringThe font family name`"ABeeZee"``urlString`stringA URL-friendly CSS font string used for loading`"abeezee:400,400i"````
use Apsonex\Font\FontDTO;

// Creating a FontDTO object (usually returned from provider methods)
$font = new FontDTO(
    key: 'abeezee',
    provider: 'bunny',
    category: 'sans-serif',
    family: 'ABeeZee',
    urlString: 'abeezee:400,400i'
);

// Accessing properties
echo "Font Key: " . $font->key . PHP_EOL;             // Output: abeezee
echo "Provider: " . $font->provider . PHP_EOL;        // Output: bunny
echo "Category: " . $font->category . PHP_EOL;        // Output: sans-serif
echo "Family: " . $font->family . PHP_EOL;            // Output: ABeeZee
echo "CSS URL String: " . $font->urlString . PHP_EOL; // Output: abeezee:400,400i
```

FontResponse `(Apsonex\Font\FontResponse)`
------------------------------------------

[](#fontresponse-apsonexfontfontresponse)

- Paginated font response containing:
- fonts (array of FontDTO)
- total (int) — total matched fonts
- limit (int) — items per page
- page (int) — current page number

Testing
-------

[](#testing)

This package uses Pest PHP for testing.

```
./vendor/bin/pest
```

Extending with other Providers
------------------------------

[](#extending-with-other-providers)

You can implement your own provider by creating a class that implements:

```
use Apsonex\Font\Contracts\FontProviderInterface;

class YourProvider implements FontProviderInterface
{
    public function list(int $limit, int $page): FontResponse { /*...*/ }
    public function search(string $keyword, int $limit, int $page): FontResponse { /*...*/ }
    public function findByKey(string $key): ?FontDTO { /*...*/ }
    // Implement other methods from interface...
}
```

Then register it:

```
    $fontManager->useProvider(new YourProvider());
```

License
-------

[](#license)

MIT License © Apsonex Inc

Contributing
------------

[](#contributing)

Feel free to open issues and pull requests!

###  Health Score

35

—

LowBetter than 79% of packages

Maintenance54

Moderate activity, may be stable

Popularity18

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 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.

###  Release Activity

Cadence

Every ~0 days

Total

5

Last Release

348d ago

### Community

Maintainers

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

---

Top Contributors

[![gurindersingh](https://avatars.githubusercontent.com/u/6223752?v=4)](https://github.com/gurindersingh "gurindersingh (7 commits)")

---

Tags

fontapsonex

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

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

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

###  Alternatives

[fortawesome/font-awesome

The iconic font, CSS, and SVG framework

76.5k7.3M125](/packages/fortawesome-font-awesome)[kartik-v/bootstrap-star-rating

A simple yet powerful JQuery star rating plugin for Bootstrap.

1.1k4.5M5](/packages/kartik-v-bootstrap-star-rating)[rmrevin/yii2-fontawesome

Asset Bundle for Yii2 with Font Awesome

1474.0M131](/packages/rmrevin-yii2-fontawesome)[orlandotm/payment-webfont

An SVG webfont full of main payment system icons

1.2k10.4k](/packages/orlandotm-payment-webfont)[kartik-v/yii2-icons

Set of icon frameworks for use in Yii Framework 2.0

73970.3k34](/packages/kartik-v-yii2-icons)[tecnickcom/tc-lib-pdf-font

PHP library containing PDF page formats and definitions

21773.2k5](/packages/tecnickcom-tc-lib-pdf-font)

PHPackages © 2026

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