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

Add unique glyph names for CFF fonts.

Printing on MacOS was broken with the previous approach of just mapping
all the glyphs to notdef.
This commit is contained in:
Brendan Dahl 2019-02-26 15:57:46 -08:00
parent 9f9d87c3ce
commit 8a596ef5d5
3 changed files with 89 additions and 18 deletions

View file

@ -3333,16 +3333,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