remove glyph references outside range of avaialable glyphs

This commit is contained in:
notmasteryet 2011-12-07 21:38:34 -06:00
parent cb592d6e51
commit fa18c8022e
4 changed files with 14 additions and 0 deletions

View File

@ -1785,6 +1785,12 @@ var Font = (function Font() {
}
properties.hasShortCmap = hasShortCmap;
// remove glyph references outside range of avaialable glyphs
for (var i = 0, ii = ids.length; i < ii; i++) {
if (ids[i] >= numGlyphs)
ids[i] = 0;
}
createGlyphNameMap(glyphs, ids, properties);
this.glyphNameMap = properties.glyphNameMap;

View File

@ -17,3 +17,4 @@
!devicen.pdf
!cmykjpeg.pdf
!issue840.pdf
!freeculture.pdf

BIN
test/pdfs/freeculture.pdf Normal file

Binary file not shown.

View File

@ -87,6 +87,13 @@
"rounds": 1,
"type": "eq"
},
{ "id": "freeculture",
"file": "pdfs/freeculture.pdf",
"md5": "dcdf3a8268e6a18938a42d5149efcfca",
"rounds": 1,
"pageLimit": 5,
"type": "eq"
},
{ "id": "wnv_chinese-pdf",
"file": "pdfs/wnv_chinese.pdf",
"md5": "db682638e68391125e8982d3c984841e",