4
votes

I'm trying to create a simple pdf doc using javascript. I found jsPDF but I don't figure out how to use "CALIBRI" font text. Is it possible?

1
Have you rendered it on a browser as calibri?ergonaut

1 Answers

0
votes

Unfortunaletly I don't think that is possible. The documentation states that you can use getFontList() to see what fonts are available. As you can see below it returns courier, times and helvetica.

var doc = new jsPDF();
var elem = document.getElementById('fonts');
elem.innerText = Object.keys(doc.getFontList()).join(', ');
<script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/1.1.135/jspdf.min.js"></script>
<ul id="fonts"></ul>

The capitalized versions of the fonts returned seem to be only for ease of use and are the same as the none-capitalized fonts.