From 77eee72f91477e5c4f0962d6ef51cfb9c1205082 Mon Sep 17 00:00:00 2001 From: "mintlify[bot]" <109931778+mintlify[bot]@users.noreply.github.com> Date: Thu, 14 May 2026 17:55:45 +0000 Subject: [PATCH] docs: document Pro Reports PDF font override filter --- .../agency/create-custom-report-templates.mdx | 43 ++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) diff --git a/add-ons/agency/create-custom-report-templates.mdx b/add-ons/agency/create-custom-report-templates.mdx index a88ba2a..7e75c4c 100644 --- a/add-ons/agency/create-custom-report-templates.mdx +++ b/add-ons/agency/create-custom-report-templates.mdx @@ -169,7 +169,9 @@ If you use multiple font weights, load each font file separately. Defining bold ### Font Works in Preview but Not PDF -Some Pro Reports versions apply a PDF fallback font during PDF generation. If the custom font works in the browser preview but the generated PDF still uses a default font, keep the `@font-face` declarations in the template `` and add a second stylesheet immediately after the opening `` tag. +By default, Pro Reports does not inject a PDF-only font override, so custom template fonts—including valid `@font-face` declarations—flow through to Dompdf. If Dompdf cannot resolve the requested font, it falls back to its `defaultFont` option. + +If the custom font works in the browser preview but the generated PDF still uses a different font, keep the `@font-face` declarations in the template `` and add a second stylesheet immediately after the opening `` tag. This later stylesheet can reapply the custom font for the PDF output: @@ -188,6 +190,45 @@ This later stylesheet can reapply the custom font for the PDF output: Use this override only when the generated PDF ignores a valid custom font that works in the preview. +#### Inject a global PDF font override with a filter + +If you need to apply the same PDF-only font override to every report without editing each template, use the `mainwp_pro_reports_pdf_font_override_css` filter. Returning a CSS string from this filter injects a `