I use the Montserrat Font for creating PDF’s with jsPDF 2.5.2 and I need letter spacing for numbers.
For my website it works when I add: font-feature-settings: “tnum”
@font-face {
font-family: "Montserrat-Regular";
font-feature-settings: "tnum";
font-style: normal;
font-weight: 400;
}
is it possible to do the same with jsPDF
I tried this but it doesn’t work perfect for me
function addFonts(doc) {
const montserratRegular = readFile('/fonts/Montserrat-Regular.js');
doc.addFileToVFS('Montserrat-Regular-normal.ttf', montserratRegular);
doc.addFont('Montserrat-Regular-normal.ttf', 'Montserrat-Regular', 'normal');
}
doc.setFontSize(10);
doc.setFont('Montserrat-Regular', 'normal');
doc.text('124.11', 100, 50, {align:'right', charSpace:'0.1'});
thanks for nice tips