1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-22 16:18:08 +02:00

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;
}