PHPackages                             tecnickcom/tc-lib-pdf-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. [PDF &amp; Document Generation](/categories/documents)
4. /
5. tecnickcom/tc-lib-pdf-font

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

tecnickcom/tc-lib-pdf-font
==========================

PHP library containing PDF page formats and definitions

3.9.0(4d ago)21897.9k↓25.1%104LGPL-3.0-or-laterPHPPHP &gt;=8.2CI passing

Since Dec 3Pushed 3w ago4 watchersCompare

[ Source](https://github.com/tecnickcom/tc-lib-pdf-font)[ Packagist](https://packagist.org/packages/tecnickcom/tc-lib-pdf-font)[ Docs](https://tcpdf.org)[ GitHub Sponsors](https://github.com/sponsors/tecnickcom)[ RSS](/packages/tecnickcom-tc-lib-pdf-font/feed)WikiDiscussions main Synced 2d ago

READMEChangelogDependencies (19)Versions (133)Used By (4)Security (1)

tc-lib-pdf-font
===============

[](#tc-lib-pdf-font)

> Font import, metrics, and stack management utilities for PDF generation.

[![Latest Stable Version](https://camo.githubusercontent.com/40e0ded9856bfd90415658a8fb91de6d0e3fc572c42a59246423de3384d3bbfe/68747470733a2f2f706f7365722e707567782e6f72672f7465636e69636b636f6d2f74632d6c69622d7064662d666f6e742f76657273696f6e)](https://packagist.org/packages/tecnickcom/tc-lib-pdf-font)[![Build](https://github.com/tecnickcom/tc-lib-pdf-font/actions/workflows/check.yml/badge.svg)](https://github.com/tecnickcom/tc-lib-pdf-font/actions/workflows/check.yml)[![Coverage](https://camo.githubusercontent.com/a6e5d16455bf3ed965730df64ecead0764f293c375e22692e5a9439782e41fcd/68747470733a2f2f636f6465636f762e696f2f67682f7465636e69636b636f6d2f74632d6c69622d7064662d666f6e742f67726170682f62616467652e7376673f746f6b656e3d77474e36556e4f41466f)](https://codecov.io/gh/tecnickcom/tc-lib-pdf-font)[![License](https://camo.githubusercontent.com/e05ad699021e56aa4a110e5a0a921cbd93137da4d6819766edab1f32c1d2a64d/68747470733a2f2f706f7365722e707567782e6f72672f7465636e69636b636f6d2f74632d6c69622d7064662d666f6e742f6c6963656e7365)](https://packagist.org/packages/tecnickcom/tc-lib-pdf-font)[![Downloads](https://camo.githubusercontent.com/680451f05e254877b5268dd32d0d35fffd01c9d9e7b50d28cee3079584bfc6c0/68747470733a2f2f706f7365722e707567782e6f72672f7465636e69636b636f6d2f74632d6c69622d7064662d666f6e742f646f776e6c6f616473)](https://packagist.org/packages/tecnickcom/tc-lib-pdf-font)

[![Sponsor on GitHub](https://camo.githubusercontent.com/dd89cb32d6e7ff9dbb0fa7ce84923567358b220feb9198b3720beabc3153da6a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f73706f6e736f722d6769746875622d4541344141412e7376673f6c6f676f3d67697468756273706f6e736f7273266c6f676f436f6c6f723d7768697465)](https://github.com/sponsors/tecnickcom)

> 💖 Part of the [tc-lib-pdf / TCPDF](https://github.com/tecnickcom/tc-lib-pdf) ecosystem (100M+ installs). [Sponsor its maintenance →](https://github.com/sponsors/tecnickcom)

---

Overview
--------

[](#overview)

`tc-lib-pdf-font` provides font import and runtime font-stack services used by PDF composition engines.

It bridges static font assets and runtime document composition by handling metrics, encodings, and font program references in a PDF-friendly way. This modular design lets applications evolve font workflows independently from the rest of the rendering stack.

**Namespace**`\Com\Tecnick\Pdf\Font`**Author**Nicola Asuni **License**[GNU LGPL v3](https://www.gnu.org/copyleft/lesser.html) - see [LICENSE](LICENSE)**API docs****Packagist**---

Features
--------

[](#features)

### Font Processing

[](#font-processing)

- Import support for core, Type1, and TrueType sources
- Font metadata extraction and normalization
- Utilities for subset and output dictionary generation
- Optional injectable cache to reuse computed TrueType font subsets

### Runtime Font Stack

[](#runtime-font-stack)

- Font stack insertion and switching
- Glyph width/bounding-box helpers
- Character replacement and fallback handling

---

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

[](#requirements)

- PHP 8.2 or later
- Extensions: `json`, `pcre`, `zlib`
- Composer

---

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

[](#installation)

```
composer require tecnickcom/tc-lib-pdf-font
```

---

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

[](#quick-start)

```
