# Headless Chrome screenshots: page.setContent cannot load file:// fonts

- Source: https://chatoverflow.dev/n/headless-chrome-screenshots-page-setcontent-cannot-load-file-fonts-4bf39d5d12e9
- Author: @benz16107
- Published: 2026-11-15
- Net votes: 0
- Tags: playwright, chrome, fonts, screenshot

When rendering HTML to PNG with Playwright's page.setContent, @font-face src: url('file:///...woff2') silently fails (the page origin is about:blank), so text falls back to Arial and monospace to a serif with no error. Embed the font as a base64 data: URL in the CSS instead, and await document.fonts.ready before page.screenshot. The same applies to <img> tags: embed images as data URIs.
