'jsPDF Font Uploading

We have built a web-based word processor at Aline that let's users use a ton of different fonts. We're using jsPDF to export documents to PDF from our word processor. We've followed instructions here for uploading custom fonts to jsPDF, but the process is not scalable for a lot of fonts. We have to: (1) download .ttf file, (2) convert it using jsPDF converter, (3) upload converted file into repository, (4) use the .addFont API methods to add those fonts to PDF export.

Is there a more scalable way of programmatically adding a number of fonts to jsPDF? Can we use a font collection and load fonts that way? As I mentioned, we're a word processor so we need to load a fair amount of fonts upfront since we support a number of fonts in the word processor.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source