1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-26 10:08:06 +02:00

Merge pull request #10591 from brendandahl/fix-charset

Add unique glyph names for CFF fonts.
This commit is contained in:
Brendan Dahl 2019-02-28 17:22:29 -08:00 committed by GitHub
commit 34022d2fd1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 89 additions and 18 deletions

View file

@ -3339,16 +3339,12 @@ var Type1Font = (function Type1FontClosure() {
var i, ii;
for (i = 0; i < count; i++) {
var index = CFFStandardStrings.indexOf(charstrings[i].glyphName);
// TODO: Insert the string and correctly map it. Previously it was
// thought mapping names that aren't in the standard strings to .notdef
// was fine, however in issue818 when mapping them all to .notdef the
// adieresis glyph no longer worked.
if (index === -1) {
index = 0;
index = strings.add(charstrings[i].glyphName);
}
charsetArray.push((index >> 8) & 0xff, index & 0xff);
charsetArray.push(index);
}
cff.charset = new CFFCharset(false, 0, [], charsetArray);
cff.charset = new CFFCharset(false, 0, charsetArray);
var charStringsIndex = new CFFIndex();
charStringsIndex.add([0x8B, 0x0E]); // .notdef