Font Discrepancies Between Windows and Linux

PDFs generated by IronPDF on Linux look visually different from PDFs generated on Windows. Text appears in different fonts, with different spacing and layout, even when rendering the same HTML.

Windows includes Times New Roman and other Microsoft core fonts by default. Ubuntu and most Linux distributions use DejaVu Sans as the default fallback when the requested font is unavailable. When IronPDF's Chrome renderer requests a font that is not installed on the Linux system, it substitutes DejaVu Sans, producing layout differences.

Solution

Install Microsoft core fonts on the Linux system or in the Docker image:

sudo apt update
sudo apt install ttf-mscorefonts-installer
sudo apt update
sudo apt install ttf-mscorefonts-installer
SHELL

Verify that Times New Roman is available after installation:

fc-list | grep "Times New Roman"
fc-list | grep "Times New Roman"
SHELL

Restart the IronPDF application or service after font installation so the renderer picks up the newly available fonts. Regenerate the PDFs and confirm the output matches the Windows reference.

For a complete Linux Docker setup, see the Linux deployment guide.

Curtis Chau
Technical Writer

Curtis Chau holds a Bachelor’s degree in Computer Science (Carleton University) and specializes in front-end development with expertise in Node.js, TypeScript, JavaScript, and React. Passionate about crafting intuitive and aesthetically pleasing user interfaces, Curtis enjoys working with modern frameworks and creating well-structured, visually appealing manuals.

...

Read More
Ready to Get Started?
Nuget Downloads 19,345,590 | Version: 2026.6 just released
Still Scrolling Icon

Still Scrolling?

Want proof fast? PM > Install-Package IronPdf
run a sample watch your HTML become a PDF.