diff --git a/src/evaluator.js b/src/evaluator.js index f6ef31c9b..ed49f821b 100644 --- a/src/evaluator.js +++ b/src/evaluator.js @@ -161,7 +161,7 @@ var PartialEvaluator = (function PartialEvaluatorClosure() { translated = this.translateFont(font, xref, resources, dependency); } catch (e) { - translated = { error: e }; + translated = { error: e instanceof Error ? e.message : e }; } font.translated = translated; diff --git a/src/fonts.js b/src/fonts.js index 17d847a8d..e7cac1345 100644 --- a/src/fonts.js +++ b/src/fonts.js @@ -3557,6 +3557,10 @@ var Font = (function FontClosure() { this.glyphNameMap = properties.glyphNameMap; } + if (ids.length === 0) { + error('Valid glyph data is not found'); + } + // Converting glyphs and ids into font's cmap table cmap.data = createCMapTable(glyphs, ids); var unicodeIsEnabled = [];