yWorks / svg2pdf.js

A javascript-only SVG to PDF conversion utility that runs in the browser. Brought to you by yWorks - the diagramming experts
MIT License
654 stars 101 forks source link

Svg-text with custom font is not exported to pdf #64

Closed anneeberle closed 5 years ago

anneeberle commented 5 years ago

When i try to convert a text with font "Prada Regular", the text does not appear in the PDF

To reproduce use attached sample with jsPDF (commit 2f18d0f) and svg2pdf (commit 1dcf2e4). missing-label_html.txt

At the top the SVG-input is displayed and a PDF preview is shown below. While the rectangle is exported correctly, the text is missing.

I worked with Chrome Version 70.0.3538.77 on Windows 10.

fskpf commented 5 years ago

This seems to be related to the utilized font. The test case, i.e. /tests/custom-fonts.html in this repo still works (Batang.ttf), as well as the other embedded font in the attached test case of @anneeberle (mplus-1c-regular.ttf). However, the Prata-Regular.ttf is not working at all.

I've also tried it with another font in another project (Roboto.ttf) which does not work either, though there are some gibberish characters printed when used with greek or cyrillic chars. (Tested with the 'master' of svg2pdf and jspdf).

Note that all of the above worked with previous versions of svg2pdf (/dist/ changeset a955ee8) and jsPDF (/dist/ changeset dfa618c). So this looks like a regression to me.

HackbrettXXX commented 5 years ago

Was an issue of jsPDF (see https://github.com/yWorks/jsPDF/issues/18), which is now fixed