The first glyph in CFF CIDFonts must be named 0 instead of ".notdef"
Fixes #11718 in which the `ff` ligature glyph is at index zero in a CFF font. Beacuse this is a CIDFont, glyph names are CIDs, which are integers. Thus the string `".notdef"` is not correct. The rest of the charset data is already parsed correctly as integers when the boolean argument `cid` is true.
This commit is contained in:
parent
85838fc505
commit
a22c0eab48
@ -803,7 +803,7 @@ var CFFParser = (function CFFParserClosure() {
|
|||||||
var bytes = this.bytes;
|
var bytes = this.bytes;
|
||||||
var start = pos;
|
var start = pos;
|
||||||
var format = bytes[pos++];
|
var format = bytes[pos++];
|
||||||
var charset = [".notdef"];
|
const charset = [cid ? 0 : ".notdef"];
|
||||||
var id, count, i;
|
var id, count, i;
|
||||||
|
|
||||||
// subtract 1 for the .notdef glyph
|
// subtract 1 for the .notdef glyph
|
||||||
|
1
test/pdfs/.gitignore
vendored
1
test/pdfs/.gitignore
vendored
@ -254,6 +254,7 @@
|
|||||||
!bug903856.pdf
|
!bug903856.pdf
|
||||||
!bug850854.pdf
|
!bug850854.pdf
|
||||||
!bug866395.pdf
|
!bug866395.pdf
|
||||||
|
!issue11718_reduced.pdf
|
||||||
!bug1027533.pdf
|
!bug1027533.pdf
|
||||||
!bug1028735.pdf
|
!bug1028735.pdf
|
||||||
!bug1046314.pdf
|
!bug1046314.pdf
|
||||||
|
BIN
test/pdfs/issue11718_reduced.pdf
Normal file
BIN
test/pdfs/issue11718_reduced.pdf
Normal file
Binary file not shown.
@ -3339,6 +3339,12 @@
|
|||||||
"rounds": 1,
|
"rounds": 1,
|
||||||
"type": "eq"
|
"type": "eq"
|
||||||
},
|
},
|
||||||
|
{ "id": "issue11718",
|
||||||
|
"file": "pdfs/issue11718_reduced.pdf",
|
||||||
|
"md5": "a0deea064b4171bb8ea9f6e8a523e594",
|
||||||
|
"rounds": 1,
|
||||||
|
"type": "eq"
|
||||||
|
},
|
||||||
{ "id": "issue3061",
|
{ "id": "issue3061",
|
||||||
"file": "pdfs/issue3061.pdf",
|
"file": "pdfs/issue3061.pdf",
|
||||||
"md5": "696a7cb1b194d095ca3f7861779a606b",
|
"md5": "696a7cb1b194d095ca3f7861779a606b",
|
||||||
|
@ -268,7 +268,7 @@ describe("CFFParser", function() {
|
|||||||
|
|
||||||
// CID font
|
// CID font
|
||||||
charset = parser.parseCharsets(3, 2, new CFFStrings(), true);
|
charset = parser.parseCharsets(3, 2, new CFFStrings(), true);
|
||||||
expect(charset.charset).toEqual([".notdef", 8, 9]);
|
expect(charset.charset).toEqual([0, 8, 9]);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("parses charset format 2", function() {
|
it("parses charset format 2", function() {
|
||||||
@ -286,7 +286,7 @@ describe("CFFParser", function() {
|
|||||||
|
|
||||||
// CID font
|
// CID font
|
||||||
charset = parser.parseCharsets(3, 2, new CFFStrings(), true);
|
charset = parser.parseCharsets(3, 2, new CFFStrings(), true);
|
||||||
expect(charset.charset).toEqual([".notdef", 8, 9]);
|
expect(charset.charset).toEqual([0, 8, 9]);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("parses encoding format 0", function() {
|
it("parses encoding format 0", function() {
|
||||||
|
Loading…
Reference in New Issue
Block a user