tecnickcom / tc-lib-pdf-font
PHP library containing PDF page formats and definitions
Fund package maintenance!
Requires
- php: >=8.1
- ext-json: *
- ext-pcre: *
- ext-zlib: *
- tecnickcom/tc-lib-file: ^2.3
- tecnickcom/tc-lib-pdf-encrypt: ^2.1
- tecnickcom/tc-lib-unicode-data: ^2.0
Requires (Dev)
- pdepend/pdepend: ^2.16
- phpcompatibility/php-compatibility: ^10.0.0@dev
- phpmd/phpmd: ^2.15
- phpunit/phpunit: ^13.1 || ^12.5 || ^11.5 || ^10.5
- squizlabs/php_codesniffer: ^4.0
- dev-main
- 2.6.39
- 2.6.38
- 2.6.36
- 2.6.35
- 2.6.34
- 2.6.32
- 2.6.30
- 2.6.29
- 2.6.28
- 2.6.27
- 2.6.26
- 2.6.25
- 2.6.24
- 2.6.23
- 2.6.22
- 2.6.21
- 2.6.19
- 2.6.18
- 2.6.17
- 2.6.16
- 2.6.15
- 2.6.14
- 2.6.12
- 2.6.11
- 2.6.10
- 2.6.9
- 2.6.7
- 2.6.6
- 2.6.5
- 2.6.4
- 2.6.2
- 2.6.1
- 2.6.0
- 2.5.1
- 2.5.0
- 2.4.2
- 2.4.1
- 2.4.0
- 2.3.1
- 2.2.3
- 2.2.2
- 2.2.1
- 2.2.0
- 2.1.1
- 2.0.13
- 2.0.11
- 2.0.9
- 2.0.8
- 2.0.7
- 1.16.1
- 1.15.10
- 1.15.9
- 1.15.7
- 1.15.6
- 1.15.5
- 1.15.4
- 1.15.3
- 1.15.1
- 1.15.0
- 1.14.0
- 1.13.0
- 1.12.0
- 1.11.10
- 1.11.9
- 1.11.8
- 1.11.7
- 1.11.6
- 1.11.5
- 1.11.4
- 1.11.3
- 1.11.2
- 1.11.1
- 1.11.0
- 1.10.6
- 1.10.5
- 1.10.3
- 1.10.0
- 1.9.7
- 1.9.6
- 1.9.3
- 1.9.0
- 1.8.7
- 1.8.6
- 1.8.5
- 1.8.4
- 1.8.3
- 1.8.2
- 1.8.0
- 1.7.6
- 1.7.5
- 1.7.4
- 1.7.3
- 1.7.2
- 1.7.0
- 1.6.0
- 1.5.0
- 1.4.3
- 1.4.2
- 1.4.1
- 1.4.0
- 1.3.2
- 1.3.1
- 1.3.0
- 1.2.1
- 1.2.0
- 1.0.3
- 1.0.1
This package is auto-updated.
Last update: 2026-04-20 07:18:26 UTC
README
Font import, metrics, and stack management utilities for PDF generation.
If this library helps your PDF pipeline, please consider supporting development via PayPal.
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 info@tecnick.com |
| License | GNU LGPL v3 - see LICENSE |
| API docs | https://tcpdf.org/docs/srcdoc/tc-lib-pdf-font |
| Packagist | https://packagist.org/packages/tecnickcom/tc-lib-pdf-font |
Features
Font Processing
- Import support for core, Type1, and TrueType sources
- Font metadata extraction and normalization
- Utilities for subset and output dictionary generation
Runtime Font Stack
- Font stack insertion and switching
- Glyph width/bounding-box helpers
- Character replacement and fallback handling
Requirements
- PHP 8.1 or later
- Extensions:
json,pcre,zlib - Composer
Installation
composer require tecnickcom/tc-lib-pdf-font
Quick Start
<?php require_once __DIR__ . '/vendor/autoload.php'; $font = new \Com\Tecnick\Pdf\Font\Import('/path/to/font.ttf'); $metrics = $font->getFontMetrics(); var_dump($font->getFontName(), $metrics['type']);
For larger examples, refer to test/OutputTest.php and the conversion tooling in this repository.
Development
make deps
make help
make qa
Font generation helpers are also available through Make targets such as fonts.
Packaging
make rpm make deb
For system packages, bootstrap with:
require_once '/usr/share/php/Com/Tecnick/Pdf/Font/autoload.php';
Contributing
Contributions are welcome. Please review CONTRIBUTING.md, CODE_OF_CONDUCT.md, and SECURITY.md.
Contact
Nicola Asuni - info@tecnick.com