A couple of small String.fromCodePoint
improvements (PR 11698 and 11769 follow-up)
- Add a reduced test-case for issue 11768, to prevent future regressions. (Given that PR 11769 is only a work-around, rather than a proper solution, it may not be entirely accurate for the issue to be closed as fixed.) - Add more validation of the charCode, as found by the heuristics, in `PartialEvaluator._buildSimpleFontToUnicode` to prevent future issues.
This commit is contained in:
parent
50bc4a18e8
commit
44b4a74f48
@ -2587,7 +2587,7 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
|
||||
code = unicode;
|
||||
}
|
||||
}
|
||||
if (code > 0 && Number.isInteger(code)) {
|
||||
if (code > 0 && code <= 0x10ffff && Number.isInteger(code)) {
|
||||
// If `baseEncodingName` is one the predefined encodings, and `code`
|
||||
// equals `charcode`, using the glyph defined in the baseEncoding
|
||||
// seems to yield a better `toUnicode` mapping (fixes issue 5070).
|
||||
|
1
test/pdfs/.gitignore
vendored
1
test/pdfs/.gitignore
vendored
@ -236,6 +236,7 @@
|
||||
!issue4061.pdf
|
||||
!issue4668.pdf
|
||||
!PDFJS-7562-reduced.pdf
|
||||
!issue11768_reduced.pdf
|
||||
!issue5039.pdf
|
||||
!issue5070.pdf
|
||||
!issue5238.pdf
|
||||
|
BIN
test/pdfs/issue11768_reduced.pdf
Normal file
BIN
test/pdfs/issue11768_reduced.pdf
Normal file
Binary file not shown.
@ -3109,6 +3109,12 @@
|
||||
"type": "text",
|
||||
"about": "Invisible (and broken) TrueType font used for text-selection."
|
||||
},
|
||||
{ "id": "issue11768",
|
||||
"file": "pdfs/issue11768_reduced.pdf",
|
||||
"md5": "0cafde97d78bb6883531a325a996a5ef",
|
||||
"rounds": 1,
|
||||
"type": "eq"
|
||||
},
|
||||
{ "id": "issue1912",
|
||||
"file": "pdfs/issue1912.pdf",
|
||||
"md5": "15305b7c2cba971e7423de3f6ad38fef",
|
||||
|
Loading…
Reference in New Issue
Block a user