diff --git a/src/core/evaluator.js b/src/core/evaluator.js index 9bc1e75efe5f6..cff8b9f3304db 100644 --- a/src/core/evaluator.js +++ b/src/core/evaluator.js @@ -723,16 +723,25 @@ var PartialEvaluator = (function PartialEvaluatorClosure() { return errorFont(); } } + let fallbackFont = false; if (!fontRef) { warn('fontRef not available'); - return errorFont(); + // Fallback to some default font. It will fallback to Helvetica. + this.handler.send('UnsupportedFeature', + { featureId: UNSUPPORTED_FEATURES.font, }); + fallbackFont = new Dict(xref); + fallbackFont._map.Subtype = new Name('Type1'); + fallbackFont._map.BaseFont = new Name('PDFJS-FallbackFont'); } - if (this.fontCache.has(fontRef)) { + if (fontRef && this.fontCache.has(fontRef)) { return this.fontCache.get(fontRef); } font = xref.fetchIfRef(fontRef); + if (fallbackFont) { + font = fallbackFont; + } if (!isDict(font)) { return errorFont(); }