1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-22 16:18:08 +02:00

Take the FirstChar/LastChar properties into account when computing the hash in PartialEvaluator.preEvaluateFont (issue 10665)

Without this some fonts may incorrectly end up with matching `hash`es, thus breaking rendering since we'll not actually try to load/parse some of the fonts.
This commit is contained in:
Jonas Jenwald 2019-03-27 00:25:34 +01:00
parent a2a824ed01
commit 9077abc263
4 changed files with 12 additions and 0 deletions

View file

@ -2350,6 +2350,10 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
}
}
const firstChar = (dict.get('FirstChar') || 0);
const lastChar = (dict.get('LastChar') || (composite ? 0xFFFF : 0xFF));
hash.update(`${firstChar}-${lastChar}`);
var toUnicode = dict.get('ToUnicode') || baseDict.get('ToUnicode');
if (isStream(toUnicode)) {
var stream = toUnicode.str || toUnicode;