Closed zhyale closed 2 years ago
try add font-family in svg, and it will use fonts defines in jsPDF
<svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
<style>
text {
font-family: MiSan-Normal;
};
</style>
<text > 文字 </text>
</svg>
try add font-family in svg, and it will use fonts defines in jsPDF
<svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"> <style> text { font-family: MiSan-Normal; }; </style> <text > 文字 </text> </svg>
Thank you very much, it works now :)
@zhyale I ran into the same issue and switched over to svg2pdf. However, I'm not able to get the correct fonts passed to my svg. Do you have an example of how you accomplished this task?
I have created a custom Chinese font MiSans-Normal for jsPDF, and test OK for jspdf.text() , but Chinese characters are still messy code in jspdf.svg( ) . I am not sure whether it is a bug, or any option need to be configured, can you help me, thank you :)