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.

custom-font Verdana does not seem to work

See original GitHub issue

Thank you for submitting an issue to jsPDF. Please read carefully.

Are you using the latest version of jsPDF? Yes Have you tried using jspdf.debug.js? Yes

Prologue:

I am trying to implement Verdana to be able to print Umlaute in the pdf with my chosen font.

I have checked out all the other issues regarding custom fonts and utf-8. I have also checked out the example codes in the hope I would be able to figure this out by my own.

From the example I know that UTF-8 support works, so I assume that I did something wrong somewhere.

To limit the error sources I tried to get it to work by changing only the necessary parts from the repository example code.

The Umlaute do work with PTSans.

Steps to reproduce

Download jsPDF repository master branch and the Verdana.ttf from here.

Use the fontconverter from the browser and choose the just downloaded Verdana.ttf. Take the output javascript file (Verdana-normal.js) from the converter, copy it in the js folder from the repository and include it in the basic.html between the basic.js and the jspdf.debug.js include.

In the basic.js use following code:

    var doc = new jsPDF();
    doc.setFont('Verdana','normal');
    doc.setFontSize(10);
    doc.text("test123", 10, 10);
    doc.text("ää öö", 10, 30);
    doc.save('test.pdf');

(I also tried replacing the base64 code and the variable names etc. in the basic.js file without including the generated Verdana-normal.js. No success.)

Ideally a link too. Try fork this http://jsbin.com/rilace/edit?html,js,output

What I saw

A bunch of rectangles where the letters should have been. Not even “test123” was written correctly in the pdf file.

What I expected test123 and ää öö printed in the pdf file.

I would appreciate any kind of help or suggestion. If you need more information, let me know.

Kind regards from Stuttgart

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
Uzlopakcommented, Nov 4, 2018

We hopefully release 1.4.2 in few days. For now you can only build the project.

npm run-script install

0reactions
Remonellcommented, Nov 4, 2018

Alright, I understand. Thank you very much. I really appreciate all your work and support!

Read more comments on GitHub >

github_iconTop Results From Across the Web

custom-font Verdana does not seem to work #2037 - GitHub
Have you tried using jspdf.debug.js? ... Prologue: I am trying to implement Verdana to be able to print Umlaute in the pdf with...
Read more >
How to: use custom fonts – Help - Clausebase
ClauseBase offers a variety of standard fonts — such as Arial, Times New Roman and Verdana — from which you can choose in...
Read more >
wordpress 6 theme.json custom fonts are not working
I was able to apply the fonts by styling them in the style secretion. But, I never was able to do it in...
Read more >
Custom Fonts in Android - Stack Overflow
You can use simple EasyFonts third party library to set variety of custom font to your TextView . ... This library does not...
Read more >
All about fonts | Help Center - Foleon
If you can't successfully upload a custom font to the font library, it's probably a corrupt file. This often means that it originates...
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