custom fonts in jspdf take effect but not for svg
zhyale opened this issue · 3 comments
zhyale commented
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 :)
carwestsam commented
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>
zhyale commented
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 :)