Skip to content

Commit cf5a774

Browse files
committed
Fix for embedding fonts into PDF (font name must not contain spaces) #1314
1 parent 704a005 commit cf5a774

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
- Add an option to keep the indentation after a new line starts and allow to indent a whole paragraph/text element
1010
- Fix sets tab order to "Structure" when a document is tagged
1111
- Fix font cache collision for fonts with missing postscript name or bad TTF metadata or identical metadata for different fonts
12+
- Fix for embedding fonts into PDF (font name must not contain spaces)
1213
- Fix measuring text when OpenType features are passed in to .text()
1314

1415
### [v0.15.2] - 2024-12-15

lib/font/embedded.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ class EmbeddedFont extends PDFFont {
153153
const tag = [1, 2, 3, 4, 5, 6]
154154
.map(i => String.fromCharCode((this.id.charCodeAt(i) || 73) + 17))
155155
.join('');
156-
const name = tag + '+' + this.font.postscriptName;
156+
const name = tag + '+' + this.font.postscriptName.replaceAll(' ', '_');
157157

158158
const { bbox } = this.font;
159159
const descriptor = this.document.ref({

0 commit comments

Comments
 (0)