Font family not exported correctly in PNG
Author: haoshuai-misCreated May 22, 2025Updated May 19, 2026
Labelsbug
I have been using the library's `toPng` function to convert SVG charts into PNGs. After I updated the `html-to-image` version from 1.11.11 to 1.11.13, I noticed some exported PNGs no longer have the fonts. I used `@font-face` to define font families, so users can view the SVGs or PNGs in the correct font even if they don't have them installed locally.
### Expected Behavior
The `toPng` function should always return a PNG file that looks exactly the same as the webpage, like a screenshot.
### Current Behavior
The `toPng` function returns a PNG file with no custom fonts.
### Possible Solution
I am not sure how to solve this.
### Steps To Reproduce
1. Create an SVG with custom fonts on your page
2. Use the `toPng` function to select the SVG by its custom `id` and download the PNG file
### Additional Context
### Your Environment
- html-to-image: 1.11.13
- OS: macOS Sequoia 15.5
- Browser: all browsers
Source: bubkoo/html-to-image