Pass the ignoreErrors API option to the FontFaceObject constructor, and utilize it in getPathGenerator to ignore missing glyphs

Obviously it's still not possible to render non-embedded fonts as paths, but in this way the rest of the page will at least be allowed to continue rendering.

*Please note:* Including the 14 standard fonts in PDF.js probably wouldn't be *that* difficult to implement. (I'm not a lawyer, but the fonts from PDFium could probably be used given their BSD license.)
However, the main blocker ought to be the total size of the necessary font data, since I cannot imagine people being OK with shipping ~5 MB of (additional) font data with Firefox. (Based on the reactions when the CMap files were added, and those are only ~1 MB in size.)
This commit is contained in:
Jonas Jenwald 2018-06-13 11:02:06 +02:00
parent fe288bb872
commit bf0db0fb72
4 changed files with 24 additions and 1 deletions

View file

@ -1884,6 +1884,7 @@ var WorkerTransport = (function WorkerTransportClosure() {
var font = new FontFaceObject(exportedData, {
isEvalSupported: params.isEvalSupported,
disableFontFace: params.disableFontFace,
ignoreErrors: params.ignoreErrors,
fontRegistry,
});
var fontReady = (fontObjs) => {