Skip to content

Commit

Permalink
Fix - correctly restore font family after makepdf
Browse files Browse the repository at this point in the history
  • Loading branch information
linev committed Nov 28, 2024
1 parent 6f70f5f commit b8844f2
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion modules/base/makepdf.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,13 @@ async function makePDF(svg, args) {
node.removeAttribute('dy');
});

restore_text.forEach(node => { node.innerHTML = node.$originalHTML; node.setAttribute('font-family', node.$originalFont); });
restore_text.forEach(node => {
node.innerHTML = node.$originalHTML;
if (node.$originalFont)
node.setAttribute('font-family', node.$originalFont);
else
node.removeAttribute('font-family');
});

const res = args?.as_buffer ? doc.output('arraybuffer') : doc.output('dataurlstring');
if (nodejs) {
Expand Down

0 comments on commit b8844f2

Please sign in to comment.