question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Greek custom fonts, not supported in new version.

See original GitHub issue

I’m using the latest version of jsPDF and have managed to successfully implement custom fonts for almost any language (Cyrillic, Japanese etc)! But no matter what I have tried, Greek fonts are never correctly reproduced to .pdf. I encode them to Base64 using your converter and use this code:

var doc = new jsPDF();
doc.addFileToVFS("Arialbd.ttf", font);
doc.addFont("Arialbd.ttf", "arialbd", "bold");
doc.setFont('arialbd');
doc.text(50,50,'Καλημέρα');```

But instead of 'Καλημέρα' I see some bizarre characters being produced. And this happens with all the Greek fonts I have tried. Any idea why this happens with Greek characters? Is it a bug?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:10

github_iconTop GitHub Comments

1reaction
Uzlopakcommented, Dec 21, 2018

verified as a bug.

0reactions
Uzlopakcommented, Dec 27, 2018

It works as expected if you use the latest jspdf (1.5.3) and set the font to bold ( doc.setFont('Arialbd', 'bold'); )

index.zip

Read more comments on GitHub >

github_iconTop Results From Across the Web

Greek custom fonts, not supported in new version. · Issue #2174
I'm using the latest version of jsPDF and have managed to successfully implement custom fonts for almost any language (Cyrillic, ...
Read more >
PostScript Type 1 fonts end of support - Adobe Support
Previous versions of Creative Cloud apps will not be able to support Type 1 fonts once support is ended for the operating system....
Read more >
wordpress 6 theme.json custom fonts are not working
I was never able to get it to work correctly at the global settings or block level settings. I was able to apply...
Read more >
Cloud fonts in Office - Microsoft Support
Font name File name Version Abadi abadi.ttf 3.01 Abadi Extra Light abadiexlt.ttf 3.01 Agency FB Agencyr.ttf 1.03
Read more >
Fonts - ArchWiki
With older applications that do not support fontconfig (e.g. GTK 1.x ... Roboto (ttf-roboto) – Default font for newer Android versions where ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found