Browse Source

Map missing glyphs to the notdef glyph for TrueType (3, 1) fonts (issue 6068)

Fixes 6068.

The most notable issue with the font in question is that the `differences` array contains lots of strange entries (of the type `uniXXXX`, instead of proper glyph names).
Jonas Jenwald 10 years ago
parent
commit
5eae3e29c5
  1. 5
      src/core/fonts.js
  2. 1
      test/pdfs/.gitignore
  3. BIN
      test/pdfs/issue6068.pdf
  4. 7
      test/test_manifest.json

5
src/core/fonts.js

@ -4225,11 +4225,12 @@ var Font = (function FontClosure() { @@ -4225,11 +4225,12 @@ var Font = (function FontClosure() {
}
}
if (!found && properties.glyphNames) {
// Try to map using the post table. There are currently no known
// pdfs that this fixes.
// Try to map using the post table.
var glyphId = properties.glyphNames.indexOf(glyphName);
if (glyphId > 0 && hasGlyph(glyphId, -1, -1)) {
charCodeToGlyphId[charCode] = glyphId;
} else {
charCodeToGlyphId[charCode] = 0; // notdef
}
}
}

1
test/pdfs/.gitignore vendored

@ -135,4 +135,5 @@ @@ -135,4 +135,5 @@
!issue5909.pdf
!issue6010_1.pdf
!issue6010_2.pdf
!issue6068.pdf
!issue6081.pdf

BIN
test/pdfs/issue6068.pdf

Binary file not shown.

7
test/test_manifest.json

@ -1137,6 +1137,13 @@ @@ -1137,6 +1137,13 @@
"rounds": 1,
"type": "eq"
},
{ "id": "issue6068",
"file": "pdfs/issue6068.pdf",
"md5": "bbcedb94776b40352729c16940a5b2bd",
"rounds": 1,
"link": false,
"type": "eq"
},
{ "id": "tamreview",
"file": "pdfs/TAMReview.pdf",
"md5": "8039aba56790d3597d2bc8c794a51301",

Loading…
Cancel
Save