I use my custom Persian font in jsPDF, but characters for this font show me wrong.
I hear
The IranNastaliq font uses the 'cswh' feature for such ligatures. 'cswh' is default-off according to the OpenType spec. The font should use 'calt' instead. It's unfortunate
So should I set 'cswh' in the jsPDF library? How can I do that in jsPDF code?
var doc = new jsPDF();
doc.addFont("test/reference/fonts/IranNastaliq-Web.ttf", "IranNastaliq", "normal");
doc.setFont("IranNastaliq"); // Set font
doc.setFontSize(150);
var persianText = "نگار شکار";
doc.text(persianText, 10, 60);

img.src = 'data:image/svg+xml;charset=UTF-8,' + encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg"><foreignObject width="' + canvas.width + '" height="' + canvas.height + '">' + parseandserialize('نگار') + '</foreignObject></svg>');