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
643 stars 96 forks source link

Chinese is not supported #254

Closed hhly closed 1 year ago

hhly commented 1 year ago

Describe the bug A clear and concise description of what the bug is.

To Reproduce See this playground.

Expected behavior I would have expected the PDF to look like so. This is in accordance to the following SVG spec.

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context Add any other context about the problem here.

hhly commented 1 year ago
image

I added fonts, but Chinese is still garbled

yGuy commented 1 year ago

Works for me

image

The playground doesn't have a font with chinese characters loaded, but your SVG failed to specify the font name, anyway. You need to specify the font name in the SVG, too.