-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Description
Version
1.58.2
Steps to reproduce
- Assume browsers and system dependencies are already installed
git clone https://github.com/ignyx/playwright-issue.gitnpm install- Read
repro-font-spacing.mjs node repro-font-spacing.mjs- Open the newly created
font-test-headless.pdfandfont-test-headed.pdfside-by-side in your favorite pdf viewer
Expected behavior
When embedding remote fonts, I expect rendered text to have same length, regardless of headless: true/false.
Actual behavior
Text in the pdf from the headless browser is longer than the text in the headed browser.
Additional context
The fonts are successfully embedded into the PDFs.
In the HTML, an example is given with another remote font.
When commenting out the remote fonts and using the system font "Roboto", the length is identical (no issue).
This may seem trivial, but for longer paragraphs, words may overflow and the text may span more lines in the headless than in the browser (things that work in the browser look differently in the headless).
I couldn't find any related issue, or anything in the documentation, or on SO.
The issue may not be an issue with playwright itself.
Environment
System:
OS: Linux 6.12 Debian GNU/Linux 13 (trixie) 13 (trixie)
CPU: (12) x64 Intel(R) Core(TM) i7-10710U CPU @ 1.10GHz
Memory: 2.45 GB / 15.46 GB
Container: Yes
Binaries:
Node: 24.4.1 - ~/.nvm/versions/node/v24.4.1/bin/node
Yarn: 1.22.19 - /usr/bin/yarn
npm: 11.4.2 - ~/.nvm/versions/node/v24.4.1/bin/npm
pnpm: 10.14.0 - ~/.local/share/pnpm/pnpm
IDEs:
VSCode: 1.109.5 - /usr/bin/code
Languages:
Bash: 5.2.37 - /usr/bin/bash
npmPackages:
@playwright/test: ^1.58.2 => 1.58.2Thanks for your help !
