Replace command with not enough args by an endchar in CFF font
- Right now, a glyph with an erroneous outline is replaced by an empty glyph if the error is far enough from the start there's likely something to render so the idea is to replace a command with args by an endchar when no args are on the stack: this way OTS is likely happy (no remaining args on stack) and we can draw something which is likely better than nothing.
This commit is contained in:
parent
e394da5861
commit
1a2cea21a5
@ -626,6 +626,14 @@ const CFFParser = (function CFFParserClosure() {
|
||||
", expected: " +
|
||||
validationCommand.min
|
||||
);
|
||||
|
||||
if (stackSize === 0) {
|
||||
// Just "fix" the outline in replacing command by a endchar:
|
||||
// it could lead to wrong rendering of some glyphs or not.
|
||||
// For example, the pdf in #6132 is well-rendered.
|
||||
data[j - 1] = 14;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
1
test/pdfs/.gitignore
vendored
1
test/pdfs/.gitignore
vendored
@ -129,6 +129,7 @@
|
||||
!bug1513120_reduced.pdf
|
||||
!bug1538111.pdf
|
||||
!bug1552113.pdf
|
||||
!issue6132.pdf
|
||||
!issue9949.pdf
|
||||
!bug1308536.pdf
|
||||
!bug1337429.pdf
|
||||
|
BIN
test/pdfs/issue6132.pdf
Normal file
BIN
test/pdfs/issue6132.pdf
Normal file
Binary file not shown.
@ -2616,6 +2616,12 @@
|
||||
"rounds": 1,
|
||||
"type": "eq"
|
||||
},
|
||||
{ "id": "issue6132",
|
||||
"file": "pdfs/issue6132.pdf",
|
||||
"md5": "bd1e6252ca642acf2cd05db1748a073c",
|
||||
"rounds": 1,
|
||||
"type": "eq"
|
||||
},
|
||||
{ "id": "issue4875",
|
||||
"file": "pdfs/issue4875.pdf",
|
||||
"md5": "9a558e18029a42c0ef4e9a8755e24733",
|
||||
|
Loading…
Reference in New Issue
Block a user