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
655 stars 101 forks source link

Custom font usage #25

Closed phyzalis closed 7 years ago

phyzalis commented 7 years ago

Hi

Is there anyway to add custom font in pdf generation?

I have a custom font in my svg included with a def like this:

<defs>
  <style type="text/css">
    @import url(http://fonts.googleapis.com/css?family=Indie+Flower);
  </style>
</defs>

Everything is fine in my svg, but when I convert to pdf, the default font is used. Anything about this?

Many thanks

yGuy commented 7 years ago

That's actually a JSPDF issue.

There is one project that tries to solve this: https://github.com/sphilee/jsPDF-CustomFonts-support

This cannot and should not be fixed in svg2pdf.