For non-embedded fonts, map softhyphen (0x00AD) to regular hyphen (0x002D) (issue 9084)

In the PDF file, the `ToUnicode` data first maps the hyphen correctly, and then *overwrites* it to point to the softhyphen instead. That one cannot be rendered in browsers, and an empty space thus appear instead.

Fixes 9084.
This commit is contained in:
Jonas Jenwald 2017-10-31 13:01:29 +01:00
parent 92fcfce685
commit 83e8398ff2
4 changed files with 10 additions and 0 deletions

View File

@ -51,6 +51,8 @@ function mapSpecialUnicodeValues(code) {
return 0;
} else if (code >= 0xF600 && code <= 0xF8FF) {
return (getSpecialPUASymbols()[code] || code);
} else if (code === 0x00AD) { // softhyphen
return 0x002D; // hyphen
}
return code;
}

View File

@ -62,6 +62,7 @@
!issue8707.pdf
!issue8798r.pdf
!issue8823.pdf
!issue9084.pdf
!bad-PageLabels.pdf
!filled-background.pdf
!ArabicCIDTrueType.pdf

BIN
test/pdfs/issue9084.pdf Normal file

Binary file not shown.

View File

@ -711,6 +711,13 @@
"link": false,
"type": "eq"
},
{ "id": "issue9084",
"file": "pdfs/issue9084.pdf",
"md5": "5570ec01cc869d299fec1b2f68926a08",
"rounds": 1,
"link": false,
"type": "eq"
},
{ "id": "issue8707",
"file": "pdfs/issue8707.pdf",
"md5": "d3dc670adde9ec9fb82c974027033029",