Stops font processing when valid glyphs are absent in the font

This commit is contained in:
Yury Delendik 2012-10-12 14:05:50 -05:00
parent 399463a450
commit 62b2c5a030
2 changed files with 5 additions and 1 deletions

View File

@ -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;

View File

@ -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 = [];