Search code examples
character-encodingjspdf

jsPDF doesn't show certain letters properly (ū)


I am trying to create a PDF File to export using jsPDF library. In one of the lines I am trying to write a word that contains this 'ū' letter,

doc.text('Hūla', 20, 30);

However, when doing so the exported file doesn't contain this letter but instead it becomes 'H k l a' with spaces in between and a k instead of the ū.

What can I do in order to have this printed properly?


Solution

  • The solution was to use a font that supports this. I had to try multiple ones in order to get it working with this letter ū (it is not a specific language)

    The font was Amiri. It also supported the Arabic font.