Skip to content

Commit

Permalink
Fix fonts without a postscriptName #1590
Browse files Browse the repository at this point in the history
  • Loading branch information
liborm85 committed Jan 18, 2025
1 parent f446608 commit 1abb354
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
### Unreleased

- Fix precision rounding issues in LineWrapper
- Fix fonts without a postscriptName
- Add support for dynamic sizing
- Add support for rotatable text

Expand Down
2 changes: 1 addition & 1 deletion lib/font/embedded.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ class EmbeddedFont extends PDFFont {
const tag = [1, 2, 3, 4, 5, 6]
.map(i => String.fromCharCode((this.id.charCodeAt(i) || 73) + 17))
.join('');
const name = tag + '+' + this.font.postscriptName.replaceAll(' ', '_');
const name = tag + '+' + this.font.postscriptName?.replaceAll(' ', '_');

const { bbox } = this.font;
const descriptor = this.document.ref({
Expand Down

0 comments on commit 1abb354

Please sign in to comment.