JSPDF support for Chinese (Siyuan in bold) pit mining tour, JSPDF Chinese font solutions garbled

As we all know, JSPDF is an open source, easy to use, but very bad for Chinese support for the PDF library.

Now, I teach you how to use the source in bold in the pdf. Siyuan blackbody is open source fonts. Siyuan black body with a very wide range of use, practicality is also important to select a font to avoid the risk of copyright! Please strictly follow what I say!

1, ready Siyuan bold ttf file, do not use otf file , as follows

https://github.com/be5invis/source-han-sans-ttf/releases

 

.

 

We picked one of the SourceHanSans-Bold.ttf and SourceHanSans-Normal.ttf to use, on behalf of a thick one thin.

2, the downloaded font naming all to lowercase , as follows

 

 Why to lowercase, see  issues2465  , named for the capital of the failure of all -

 

 

 

Convert this site https://rawgit.com/MrRio/jsPDF/master/fontconverter/fontconverter.html

Note that this website even hung up, we can find the source code converter jspdf in  https://github.com/MrRio/jsPDF/blob/master/fontconverter/fontconverter.html

 3, so we get these two files

 

 PS: font is bold font, fontStyle site you choose bold, normal, too!

 

Open these two files with Notepad (win), do not use the editor, will be extremely card, unless you high memory, what love mac open what is open, double-click the selected string of long, ctrl + c.

 

Guess you like

Origin www.cnblogs.com/ww01/p/11496213.html