1

I'm using jsPDF and trying to import a custom font in my react single-page-app using create-react-app. I followed the steps here to create a js file with my font using the jspdf font converter. I am importing my js file containing my font using the steps in Tunc's answer to this related question, but I'm still getting the following error message, "jsPDF PubSub Error No unicode cmap for font Error: No unicode cmap for font". The font file I'm using for the converter is the desktop font (tff format) from here: https://www.cufonfonts.com/font/wingdings

Here is my js file with my font:

import jsPDF from "jspdf"; //added to get rid of error message "jsPDF not defined" for my react SPA

(function(jsPDFAPI) {
var font = [I clipped the giant font text for this post];
var callAddFont = function() {
  this.addFileToVFS("wingdings-normal.ttf", font);
  this.addFont("wingdings-normal.ttf", "wingdings", "normal");
};
jsPDFAPI.events.push(["addFonts", callAddFont]);
})(jsPDF.API);

When I import the js font file in my react component import "../wingdings-normal"; I get the "No unicode cmap for font" error message. Is the font cmap removed in the converter?

John S
  • 386
  • 1
  • 3
  • 17
  • Wingdings likely is not a unicode font – Kevin Brown Oct 02 '19 at 16:12
  • @KevinBrown, thanks for your input. Do you have a recommendation for rendering a checked and unchecked checkbox as text? I found this page for dec & hex unicode equivalent for wingdings2 font but I haven't had any success adding this to my pdf as of yet: http://www.alanwood.net/demos/wingdings-2.html – John S Oct 03 '19 at 01:40
  • Msgothic likely has the characters – Kevin Brown Oct 03 '19 at 16:58

0 Answers0