With Custom fonts Arabic text is breaking
See original GitHub issuedocument.autoTable({ head, body, startY: XX, styles: { lineColor: '#c7c7c7', lineWidth: 0, cellPadding: 2}, headStyles: { fillColor: '#ffffff', textColor: '#333333', font: '**Helvetica**' }, bodyStyles: { fillColor: '#f5f5f5', textColor: '#333333', fontSize: 7, lineColor: '#c7c7c7', lineWidth: 0 } });
head am passing as below:
const head = [{ content: "طيران الإمارات", styles: { valign: 'centre', cellPadding: {top: 3}, fontSize: 9, fontStyle: 'bold', cellWidth: 110.6 }, }, { content: 'Miles', styles: { fontSize: 9, fontStyle: 'normal', valign: 'centre', cellWidth: 35 }, }, { content: 'Tier Miles', styles: { fontSize: 9, fontStyle: 'normal', valign: 'centre', cellWidth: 35 }, } ];
with Helvetica Font, Head Text showing as Special characters.
With Custom font Its showing in Arabic but word is breaking I have passed as header this “طيران الإمارات” but in pdf its showing as this طير لإما
** Breaking word
Can you please me help on this
Issue Analytics
- State:
- Created 3 years ago
- Comments:6
Top GitHub Comments
Here you go :
custom-font.zip
Amiri
from google fonts)js
filejs
file after importing bothjsPDF
andjsPDF-AutoTable
Just one thing, I noticed that some fonts may have small problems with some of the letters (letters compilations or tashkeel) , so you will need to test couple of fonts before deciding on a good font to use.
Check if it does the same with
jsPDF
then it’s a font problem, otherwise create a codepen replicating the problem