PHPackages                             dskripchenko/php-pdf-fonts-liberation - 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. [PDF &amp; Document Generation](/categories/documents)
4. /
5. dskripchenko/php-pdf-fonts-liberation

ActiveLibrary[PDF &amp; Document Generation](/categories/documents)

dskripchenko/php-pdf-fonts-liberation
=====================================

Liberation font family bundle for dskripchenko/php-pdf. Metric-compatible with Arial / Times New Roman / Courier New. SIL OFL 1.1 fonts + MIT wrapper.

v1.0.0(3w ago)03MITPHPPHP ^8.2

Since May 15Pushed 3w agoCompare

[ Source](https://github.com/dskripchenko/php-pdf-fonts-liberation)[ Packagist](https://packagist.org/packages/dskripchenko/php-pdf-fonts-liberation)[ Docs](https://github.com/dskripchenko/php-pdf-fonts-liberation)[ RSS](/packages/dskripchenko-php-pdf-fonts-liberation/feed)WikiDiscussions main Synced 1w ago

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

dskripchenko/php-pdf-fonts-liberation
=====================================

[](#dskripchenkophp-pdf-fonts-liberation)

Liberation font family bundle for [`dskripchenko/php-pdf`](https://github.com/dskripchenko/php-pdf) — ships 12 TTFs (Sans / Serif / Mono × Regular / Bold / Italic / Bold Italic) and a ready-to-use `FontProvider` implementation.

[![Packagist](https://camo.githubusercontent.com/5950970906d00c0d2ac4bff48da9574abdca470152974e66c2ccc72bf1e26158/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f64736b7269706368656e6b6f2f7068702d7064662d666f6e74732d6c696265726174696f6e2e737667)](https://packagist.org/packages/dskripchenko/php-pdf-fonts-liberation)[![License: MIT + OFL-1.1](https://camo.githubusercontent.com/b329fc9b1e77c36a681b2c017f2b091aa9f8f025211d84886761158b8d11fce0/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542532302532422532304f464c2d2d312e312d627269676874677265656e2e737667)](#license)[![PHP](https://camo.githubusercontent.com/962aced9b09d89716dbebf186ff899754a096ff1068b6b7988675c2d9fab9331/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253545382e322d626c75652e737667)](composer.json)

---

Why a separate package
----------------------

[](#why-a-separate-package)

`dskripchenko/php-pdf` is MIT-licensed. The Liberation fonts ship under the **SIL Open Font License (OFL) 1.1**, which is permissive and GPL-compatible but distinct from MIT (different naming rules for derivatives, different redistribution clauses). Keeping fonts in a separate package:

- isolates the OFL license zone from the MIT zone;
- lets callers opt out of the ~4 MB font bundle when they ship their own fonts;
- enables future sibling packages (`php-pdf-fonts-noto`, `php-pdf-fonts-roboto`, etc.) without changing the core.

What's bundled
--------------

[](#whats-bundled)

Liberation Fonts **2.1.5** (latest stable), 12 files in `assets/fonts/`:

FamilyVariantsLiberationSansRegular, Bold, Italic, BoldItalicLiberationSerifRegular, Bold, Italic, BoldItalicLiberationMonoRegular, Bold, Italic, BoldItalicThe Liberation family is **metric-compatible** with Microsoft's proprietary fonts — text laid out for Arial / Times New Roman / Courier New will render with the same line wrapping using the Liberation equivalent, so DOCX-input → PDF and HTML-templates → PDF workflows produce identical pagination.

Glyph coverage: full Latin (Western and Eastern European), Cyrillic, Greek, Hebrew, Arabic, and Devanagari basics.

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

[](#installation)

```
composer require dskripchenko/php-pdf-fonts-liberation
```

PHP 8.2+. No native extensions required.

Usage
-----

[](#usage)

```
use Dskripchenko\PhpPdf\Build\DocumentBuilder;
use Dskripchenko\PhpPdf\Layout\Engine;
use Dskripchenko\PhpPdfFontsLiberation\LiberationFontProvider;

$bytes = DocumentBuilder::new()
    ->heading(1, 'Annual Report')
    ->paragraph('Тысяча красивых символов с правильным кернингом.')
    ->toBytes(new Engine(fontProvider: new LiberationFontProvider));
```

### Microsoft name aliasing

[](#microsoft-name-aliasing)

`LiberationFontProvider` resolves common proprietary names to their metric-compatible Liberation equivalent automatically:

Requested nameResolved to`Arial``LiberationSans``Arial-Bold``LiberationSans-Bold``Times New Roman``LiberationSerif``Times New Roman-Italic``LiberationSerif-Italic``Courier New``LiberationMono`A template that says `font-family: "Times New Roman"` works out of the box.

### Combining with system or custom fonts

[](#combining-with-system-or-custom-fonts)

Use `Dskripchenko\PhpPdf\Font\ChainedFontProvider` to stack providers so Liberation acts as a fallback for missing glyphs:

```
use Dskripchenko\PhpPdf\Font\ChainedFontProvider;
use Dskripchenko\PhpPdf\Font\DirectoryFontProvider;
use Dskripchenko\PhpPdfFontsLiberation\LiberationFontProvider;

$fonts = new ChainedFontProvider([
    new DirectoryFontProvider(__DIR__.'/my-brand-fonts'),  // checked first
    new LiberationFontProvider,                            // fallback
]);
```

License
-------

[](#license)

This package mixes two licenses:

ZoneLicense`src/` (PHP wrapper)**MIT** — see [LICENSE](LICENSE)`assets/fonts/` TTFs**SIL OFL 1.1** — see [OFL.txt](OFL.txt)Both are permissive, GPL-compatible, and allow commercial use.

Attribution
-----------

[](#attribution)

Liberation Fonts © Red Hat, Inc., Pavel Hlaváč, and others. Upstream:

###  Health Score

39

—

LowBetter than 84% of packages

Maintenance94

Actively maintained with recent releases

Popularity4

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

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

Unknown

Total

1

Last Release

25d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3aae29ece4986be5d3eea1ba57457547d2ce92fcdee466af45f69ec4079ec9c7?d=identicon)[dskripchenko](/maintainers/dskripchenko)

---

Tags

pdfttffontsPHP-PDFliberationoflarialtimes-new-romancourier-new

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/dskripchenko-php-pdf-fonts-liberation/health.svg)

```
[![Health](https://phpackages.com/badges/dskripchenko-php-pdf-fonts-liberation/health.svg)](https://phpackages.com/packages/dskripchenko-php-pdf-fonts-liberation)
```

###  Alternatives

[barryvdh/laravel-dompdf

A DOMPDF Wrapper for Laravel

7.3k95.2M356](/packages/barryvdh-laravel-dompdf)[tecnickcom/tcpdf

Deprecated legacy PDF engine for PHP. For new projects use tecnickcom/tc-lib-pdf.

4.5k107.0M545](/packages/tecnickcom-tcpdf)[mpdf/mpdf

PHP library generating PDF files from UTF-8 encoded HTML

4.7k81.2M538](/packages/mpdf-mpdf)[knplabs/knp-snappy

PHP library allowing thumbnail, snapshot or PDF generation from a url or a html page. Wrapper for wkhtmltopdf/wkhtmltoimage.

4.5k71.0M59](/packages/knplabs-knp-snappy)[spatie/browsershot

Convert a webpage to an image or pdf using headless Chrome

5.3k35.1M142](/packages/spatie-browsershot)[smalot/pdfparser

Pdf parser library. Can read and extract information from pdf file.

2.7k38.3M252](/packages/smalot-pdfparser)

PHPackages © 2026

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