phenx/php-font-lib
Read and parse TrueType, OpenType (TT glyphs) and WOFF fonts in PHP. Extract basic/advanced metadata, metrics, glyph names and shapes, generate Adobe Font Metrics (AFM), and build font subsets. Used by dompdf for font handling.
Adopt if:
Look elsewhere if:
pyftsubset, woff2, or fontkit).opentype.js or fontkit may be more performant).For Executives: *"This open-source PHP library lets us take control of font processing—reducing PDF file sizes by up to 70% for documents like invoices, contracts, and reports, while eliminating third-party tooling costs. Used by DOMPDF (a trusted PHP PDF library), it’s production-ready and saves companies like [Competitor X] $50K/year in licensing fees. For us, this means:
For Engineering: *"Why This Fits Our Stack:
Trade-offs:
Recommendation:
FontService facade for Laravel, with queue jobs for batch processing.For Design/Compliance: *"This tool ensures we only embed the glyphs we need, reducing legal risks around font licensing. For example:
How can I help you explore Laravel packages today?