react-pdf icon indicating copy to clipboard operation
react-pdf copied to clipboard

3.4.4 font changes no longer apply

Open Mudbill opened this issue 10 months ago • 19 comments

Describe the bug

I updated the library from 3.4.2 to 3.4.4 and fontFamily no longer applies. I see that there are font related changes in these updates, so perhaps it is related to that.

To Reproduce

<View>
  <Text>This is normal text</Text>
  <Text style={{ fontFamily: "Helvetica-Bold" }}>This should be bold</Text>
  <Text style={{ fontWeight: 700 }}>This should probably also be bold</Text>
  <Text style={{ fontFamily: "Courier" }}>This should use the Courier font</Text>
</View>

All of the above appear as the same, default Helvetica 400.

Expected behavior

Font changes should apply correctly.

Note: Using fontWeight before 3.4.2 didn't work either. I was only able to set bold font using Helvetica-Bold font family. Maybe Helvetica-Bold is not registered as a bold variant of Helvetica, but rather its own family?

Screenshots

image

Desktop (please complete the following information):

  • OS: macOS
  • Browser: Chrome
  • React-pdf version: 3.4.4

Mudbill avatar Apr 26 '24 08:04 Mudbill