With the basic library, if i console log 'doc.getfontlist()' i get Courier, helvetica, times, courier, helvetica, times but, say i want to use. Adding custom fonts to jspdf to use a custom font in your pdf file, you need a.ttf version of your desired font file Most fonts that you purchase or download will have this format available For example, when you download a google font, you’ll get the.ttf file for each font that you downloaded. To add the font to jspdf use our fontconverter in /fontconver/fontconverter.html
Learn how to use custom fonts in jspdf with this example on codepen. Adding custom fonts custom fonts require registration using addfont(), which accepts three parameters Font file data (base64 or url), font family name, and style This code registers and applies a custom font: I want to use custom font such as 'comic sans ms' or 'calibri' font in jspdf I have found similar question here, but mine is not working
And my code is like bel. By default, jspdf supports 14 standards as follows You can use setfont () method Otherwise, use another font such as thai font (kanit regular)
WATCH