PDF font names

16 views
Skip to first unread message

Jonas Jasas

unread,
Dec 16, 2025, 11:43:33 AM (24 hours ago) Dec 16
to Chromium-dev
Hello,

When a font is imported into the page using a combined Google Fonts URL like this:
https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap

the exported PDF does not contain the embedded font names.

However, when each weight is imported with its own separate URL:
https://fonts.googleapis.com/css2?family=Roboto:wght@400&display=block
https://fonts.googleapis.com/css2?family=Roboto:wght@700&display=block

the generated PDF does correctly include the font names.

I wrote a script that splits combined Google Fonts URLs into separate weight-specific URLs. This fixes the issue when exporting to PDF through the Chrome UI on desktop. But the same approach does not work when generating PDFs via the Chrome DevTools Protocol using `Page.printToPDF`. It appears that `printToPDF` handles fonts differently than the UI exporter.

Any insights or advice would be appreciated.

Ben Wagner

unread,
Dec 16, 2025, 3:33:18 PM (20 hours ago) Dec 16
to jonas...@gmail.com, Chromium-dev
Please open an issue ( https://crbug.com/new ) and provide steps to
reproduce as well as the PDFs generated.

As an initial diagnosis, the "combined" urls are variable fonts in a
woff2 container while the "weight-specific" urls are non-variable
instances in a woff2 container. When generating a PDF if the data
handed to Skia is raw woff2 or a variable font then the data cannot be
embedded directly into the PDF and a PDF Type3 font will be created in
the PDF. If the font data is non-woff2 non-variable non-color TrueType
then it can be embedded directly into the PDF. Skia's PDF generator is
generally putting the font name into the PDF, but many viewers do a
very poor job of displaying the font names of Type3 fonts. As a
result, in addition to the steps to reproduce and the PDFs generated,
please indicate the use case for the font names and what they might be
used for. Is it that specific viewers are not reporting the names? Is
there some other post-processing tool that would work better if it
could read the names?
> --
> --
> Chromium Developers mailing list: chromi...@chromium.org
> View archives, change email options, or unsubscribe:
> http://groups.google.com/a/chromium.org/group/chromium-dev
> ---
> You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev...@chromium.org.
> To view this discussion visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/91a87531-596c-429c-a625-2ae75d89260an%40chromium.org.
Reply all
Reply to author
Forward
0 new messages