Skip to content

Regression in 3.1.4: Google Fonts produce broken characters on first PDF render (works on second render) #3688

@NegaTiv1298

Description

@NegaTiv1298

Description

After upgrading from dompdf/dompdf 3.1.0 to 3.1.4, I encountered a font rendering regression when using external Google Fonts loaded via inside the PDF template.

Example font include:
<link href="https://fonts.googleapis.com/css2?family=Almarai:wght@400;700&display=swap" rel="stylesheet">

Observed Behavior

On a new build with no cached fonts, the first PDF render produces broken / corrupted glyphs for the Google font (see attached screenshot of broken text).

Image

On the second render, the font displays correctly (see attached screenshot of correct text).

Image

This behavior did not occur in version 3.1.0.
The issue appeared only after upgrading to 3.1.4, so it seems to be a regression.

Expected Behavior

Google Fonts loaded via should render correctly on the first PDF generation, same as in 3.1.0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions