mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-26 10:08:06 +02:00
Don't duplicate the first entry in the charCodeToGlyphId
map for CIDFontType2 fonts with a CIDToGIDMap
that already mapped the first entry to a non-zero glyphId
(issue 7544)
Fixes 7544.
This commit is contained in:
parent
b112f9f9f4
commit
0b75f63c03
4 changed files with 12 additions and 1 deletions
|
@ -2377,7 +2377,10 @@ var Font = (function FontClosure() {
|
|||
charCodeToGlyphId[charCode] = glyphId;
|
||||
}
|
||||
});
|
||||
if (dupFirstEntry) {
|
||||
if (dupFirstEntry && (isCidToGidMapEmpty || !charCodeToGlyphId[0])) {
|
||||
// We don't duplicate the first entry in the `charCodeToGlyphId` map
|
||||
// if the font has a `CIDToGIDMap` which has already mapped the first
|
||||
// entry to a non-zero `glyphId` (fixes issue7544.pdf).
|
||||
charCodeToGlyphId[0] = numGlyphs - 1;
|
||||
}
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue