Browse Source

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.
Jonas Jenwald 8 years ago
parent
commit
83e8398ff2
  1. 2
      src/core/unicode.js
  2. 1
      test/pdfs/.gitignore
  3. BIN
      test/pdfs/issue9084.pdf
  4. 7
      test/test_manifest.json

2
src/core/unicode.js

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

1
test/pdfs/.gitignore vendored

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

BIN
test/pdfs/issue9084.pdf

Binary file not shown.

7
test/test_manifest.json

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

Loading…
Cancel
Save