Skip to content

Commit 2ca8ae8

Browse files
authored
fix(textkit): cannot read units for Em (#3240)
1 parent 8a043ed commit 2ca8ae8

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

.changeset/five-rockets-battle.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@react-pdf/textkit": patch
3+
---
4+
5+
fix: cannot read units for Em

packages/textkit/src/engines/fontSubstitution/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ const fontSubstitution =
6969
if (
7070
font !== lastFont ||
7171
fontSize !== lastFontSize ||
72-
font.unitsPerEm !== lastFont.unitsPerEm
72+
font.unitsPerEm !== lastFont?.unitsPerEm
7373
) {
7474
if (lastFont) {
7575
res.push({

0 commit comments

Comments
 (0)