From b6ad7fd1033bf88378a01dd7ed486540ea5d76d1 Mon Sep 17 00:00:00 2001 From: Yury Delendik Date: Mon, 15 Oct 2012 10:01:18 -0500 Subject: [PATCH] Defines at least one glyph if none was found --- src/fonts.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/fonts.js b/src/fonts.js index 17d847a8d..74f64af14 100644 --- a/src/fonts.js +++ b/src/fonts.js @@ -3557,6 +3557,12 @@ var Font = (function FontClosure() { this.glyphNameMap = properties.glyphNameMap; } + if (glyphs.length === 0) { + // defines at least one glyph + glyphs.push({ unicode: 0xF000, code: 0xF000, glyph: '.notdef' }); + ids.push(0); + } + // Converting glyphs and ids into font's cmap table cmap.data = createCMapTable(glyphs, ids); var unicodeIsEnabled = [];