Skip to content

Commit

Permalink
Fix for embedding fonts into PDF (font name must not contain spaces) #…
Browse files Browse the repository at this point in the history
  • Loading branch information
liborm85 committed Dec 28, 2024
1 parent 704a005 commit cf5a774
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 @@ -9,6 +9,7 @@
- Add an option to keep the indentation after a new line starts and allow to indent a whole paragraph/text element
- Fix sets tab order to "Structure" when a document is tagged
- Fix font cache collision for fonts with missing postscript name or bad TTF metadata or identical metadata for different fonts
- Fix for embedding fonts into PDF (font name must not contain spaces)
- Fix measuring text when OpenType features are passed in to .text()

### [v0.15.2] - 2024-12-15
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;
const name = tag + '+' + this.font.postscriptName.replaceAll(' ', '_');

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

0 comments on commit cf5a774

Please sign in to comment.