mirror of
https://github.com/mozilla/pdf.js.git
synced 2026-12-01 16:46:07 +01:00
Take into account CharProcs keys when computing the type3 hash
It fixes #19634.
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -900,3 +900,4 @@
|
||||
!issue7821.pdf
|
||||
!issue21068.pdf
|
||||
!recursiveCompositGlyf.pdf
|
||||
!issue19634.pdf
|
||||
|
||||
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"
|
||||
}
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user