Are you using the latest version of jsPDF?
Version 1.3.2 Built on 2016-09-30T20:33:17.116Z
Have you tried using jspdf.debug.js?
Yes.
Steps to reproduce
Adding a custom google font
pdf.addFont("Raleway", "Raleway", "normal");
pdf.setFont("Raleway", "normal");
What I saw
PDF uses Times New Roman
What I expected
PDF using Raleway
jspdf.debug.js, line 790, function _getFont
fontName = fontName !== undefined ? fontName : fonts[activeFontKey].fontName;
fontStyle = fontStyle !== undefined ? fontStyle : fonts[activeFontKey].fontStyle;
if (fontName !== undefined) {
fontName = fontName.toLowerCase();
}
switch (fontName) {
case 'sans-serif':
case 'verdana':
case 'arial':
case 'helvetica':
fontName = 'helvetica';
break;
case 'fixed':
case 'monospace':
case 'terminal':
case 'courier':
fontName = 'courier';
break;
case 'serif':
case 'cursive':
case 'fantasy':
default:
fontName = 'times';
break;
}
try {
// get a string like 'F3' - the KEY corresponding tot he font + type combination.
key = fontmap[fontName][fontStyle];
} catch (e) {}
If the custom font is not inside the switch, it will always fall under "times", despite being in the font list. Since we can't access the switch from the outside, custom fonts will fail.
I am having the same issue I am trying to use Clear Sans
Most helpful comment
https://github.com/sphilee/jsPDF-CustomFonts-support