mirror of
https://github.com/mozilla/pdf.js.git
synced 2026-04-18 11:14:02 +02:00
Take into account CharProcs keys when computing the type3 hash
It fixes #19634.
This commit is contained in:
parent
652700dac6
commit
052e29cc56
@ -4469,6 +4469,19 @@ class PartialEvaluator {
|
||||
hash.update(cidToGidMap.peekBytes());
|
||||
}
|
||||
}
|
||||
|
||||
if (type.name === "Type3") {
|
||||
// Type3 fonts with the same metrics/encoding but different CharProcs
|
||||
// must not be aliased, since their glyphs may render completely
|
||||
// differently (e.g. one font uses SMask glyph programs, another uses
|
||||
// plain paths, see issue 19634).
|
||||
const charProcs = baseDict.get("CharProcs");
|
||||
if (charProcs instanceof Dict) {
|
||||
for (const [key, entry] of charProcs.getRawEntries()) {
|
||||
hash.update(entry instanceof Ref ? `${key}\0${entry}` : key);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
1
test/pdfs/.gitignore
vendored
1
test/pdfs/.gitignore
vendored
@ -900,3 +900,4 @@
|
||||
!issue7821.pdf
|
||||
!issue21068.pdf
|
||||
!recursiveCompositGlyf.pdf
|
||||
!issue19634.pdf
|
||||
|
||||
BIN
test/pdfs/issue19634.pdf
Normal file
BIN
test/pdfs/issue19634.pdf
Normal file
Binary file not shown.
@ -14112,5 +14112,12 @@
|
||||
"md5": "e4e106d20e4af10d7a5f1a5da02db66f",
|
||||
"rounds": 1,
|
||||
"type": "eq"
|
||||
},
|
||||
{
|
||||
"id": "issue19634",
|
||||
"file": "pdfs/issue19634.pdf",
|
||||
"md5": "ae33892db2a2421ec7c9c3e2aee07205",
|
||||
"rounds": 1,
|
||||
"type": "eq"
|
||||
}
|
||||
]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user