wojtekmaj / react-pdf

Display PDFs in your React app as easily as if they were images.
https://projects.wojtekmaj.pl/react-pdf
MIT License
9.34k stars 882 forks source link

Out-of-the-box fonts not rendering correctly #1787

Closed iSilkline closed 4 months ago

iSilkline commented 4 months ago

Before you start - checklist

Description

I've been using the built-in the Helvetica and Helvetica-Bold out-of-the-box font families for some time and everything worked great.

I recently updated my react-pdf package and it seems that support for out-of-the-box fonts is broken. I first noticed because bold text (Helvetica-Bold) is rendering as normal weight. I went to test Courier and Courier-Bold and they both rendered as Helvetica. I then tried Times-Roman and Times-Bold... everything is still rendering as normal Helvetica.

Steps to reproduce

Create pdf with any of the out-of-the-box font families.

Expected behavior

Using fontFamily "Helvetica" should render as Helvetica with normal font weight. Using fontFamily "Helvetica-Bold" should render as Helvetica with bold (700) font weight.

Actual behavior

Everything renders as Helvetica with normal font weight.

Additional information

No response

Environment