mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16:18:08 +02:00
Merge pull request #7639 from Snuffleupagus/bug-1252420
Replace empty CharStrings with '.notdef' in `Type1Font_wrap` to prevent OTS from rejecting the font (bug 1252420)
This commit is contained in:
commit
15e1ae4e3f
4 changed files with 16 additions and 1 deletions
|
@ -3296,7 +3296,14 @@ var Type1Font = (function Type1FontClosure() {
|
|||
var charStringsIndex = new CFFIndex();
|
||||
charStringsIndex.add([0x8B, 0x0E]); // .notdef
|
||||
for (i = 0; i < count; i++) {
|
||||
charStringsIndex.add(glyphs[i]);
|
||||
var glyph = glyphs[i];
|
||||
// If the CharString outline is empty, replace it with .notdef to
|
||||
// prevent OTS from rejecting the font (fixes bug1252420.pdf).
|
||||
if (glyph.length === 0) {
|
||||
charStringsIndex.add([0x8B, 0x0E]); // .notdef
|
||||
continue;
|
||||
}
|
||||
charStringsIndex.add(glyph);
|
||||
}
|
||||
cff.charStrings = charStringsIndex;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue