Merge pull request #8747 from brendandahl/first-cmap
Fix two cmap related issues.
This commit is contained in:
commit
ace9de6f7d
@ -1353,6 +1353,13 @@ var Font = (function FontClosure() {
|
|||||||
var offset = font.getInt32() >>> 0;
|
var offset = font.getInt32() >>> 0;
|
||||||
var useTable = false;
|
var useTable = false;
|
||||||
|
|
||||||
|
// Sometimes there are multiple of the same type of table. Default
|
||||||
|
// to choosing the first table and skip the rest.
|
||||||
|
if (potentialTable && potentialTable.platformId === platformId &&
|
||||||
|
potentialTable.encodingId === encodingId) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (platformId === 0 && encodingId === 0) {
|
if (platformId === 0 && encodingId === 0) {
|
||||||
useTable = true;
|
useTable = true;
|
||||||
// Continue the loop since there still may be a higher priority
|
// Continue the loop since there still may be a higher priority
|
||||||
@ -2393,11 +2400,9 @@ var Font = (function FontClosure() {
|
|||||||
if (cmapMappings[i].charCode !== unicodeOrCharCode) {
|
if (cmapMappings[i].charCode !== unicodeOrCharCode) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (hasGlyph(cmapMappings[i].glyphId)) {
|
charCodeToGlyphId[charCode] = cmapMappings[i].glyphId;
|
||||||
charCodeToGlyphId[charCode] = cmapMappings[i].glyphId;
|
found = true;
|
||||||
found = true;
|
break;
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (!found && properties.glyphNames) {
|
if (!found && properties.glyphNames) {
|
||||||
// Try to map using the post table.
|
// Try to map using the post table.
|
||||||
|
1
test/pdfs/.gitignore
vendored
1
test/pdfs/.gitignore
vendored
@ -56,6 +56,7 @@
|
|||||||
!issue8480.pdf
|
!issue8480.pdf
|
||||||
!issue8570.pdf
|
!issue8570.pdf
|
||||||
!issue8697.pdf
|
!issue8697.pdf
|
||||||
|
!issue8707.pdf
|
||||||
!bad-PageLabels.pdf
|
!bad-PageLabels.pdf
|
||||||
!filled-background.pdf
|
!filled-background.pdf
|
||||||
!ArabicCIDTrueType.pdf
|
!ArabicCIDTrueType.pdf
|
||||||
|
BIN
test/pdfs/issue8707.pdf
Normal file
BIN
test/pdfs/issue8707.pdf
Normal file
Binary file not shown.
@ -682,6 +682,13 @@
|
|||||||
"link": false,
|
"link": false,
|
||||||
"type": "eq"
|
"type": "eq"
|
||||||
},
|
},
|
||||||
|
{ "id": "issue8707",
|
||||||
|
"file": "pdfs/issue8707.pdf",
|
||||||
|
"md5": "d3dc670adde9ec9fb82c974027033029",
|
||||||
|
"rounds": 1,
|
||||||
|
"link": false,
|
||||||
|
"type": "eq"
|
||||||
|
},
|
||||||
{ "id": "issue5509",
|
{ "id": "issue5509",
|
||||||
"file": "pdfs/issue5509.pdf",
|
"file": "pdfs/issue5509.pdf",
|
||||||
"md5": "1975ef8db7355b1d691bc79d0749574b",
|
"md5": "1975ef8db7355b1d691bc79d0749574b",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user