jbtronics/dompdf-font-loader-bundle
A Symfony bundle that simplifies using custom fonts with Dompdf. Configure your font directories or assets and it automatically registers them, so generated PDFs can use custom fonts without manual font installation or @font-face setup.
FontMetrics registration call. This package is a pre-built, MIT-licensed version of that glue. The decision is less "buy vs. build" and more "take a 2-star dependency vs. own ~50 lines of code."cache:warmup moves that cost out of the request path — directly relevant if you have latency SLOs on PDF endpoints or run containers that scale to zero and pay cold-start penalties repeatedly.barryvdh/laravel-dompdf's font directory and pre-generate metrics in a deploy step.Consider it only when all of the following hold:
cache:warmup pipeline) — the package is not usable in Laravel, plain PHP, or non-Symfony frameworks without effectively rewriting it. As of v1.1.6, this includes Symfony 8, so current and next-major stacks are both covered.Look elsewhere (or build it yourself) when:
To executives: We need PDFs to carry our brand typeface, and the PDF engine we use does expensive font preparation work on the first render — which users feel as slow or broken downloads right after every deploy. This small, MIT-licensed Symfony add-on moves that preparation into the deploy step, so PDFs are correct and fast from the first request. It now supports Symfony 8, so it won't hold back our framework upgrade path. The risk is low because the code is tiny and we can vendor or replace it in an afternoon; the caveat remains that it's a low-adoption, single-maintainer project and only fits our Symfony services, not any Laravel work.
To engineering: It's a Symfony bundle that hooks dompdf font registration into cache:warmup, so font metrics are compiled at build/deploy time rather than lazily per container. Adopt it if we're on Symfony + dompdf and cold-start font compilation is showing up in latency or in read-only-filesystem failures. v1.1.6 is a compatibility-only release (adds Symfony 8 to the constraint) — no API changes, no migration work, and no reason to re-test anything beyond the normal composer update. Pin the version or vendor the ~one class it contains; do not introduce it as a transitive dependency elsewhere. For Laravel services, do the equivalent with the dompdf wrapper's font directory plus a build-time metrics step.
How can I help you explore Laravel packages today?