diff options
author | Chris Liddell <chris.liddell@artifex.com> | 2021-05-10 18:26:53 +0100 |
---|---|---|
committer | Chris Liddell <chris.liddell@artifex.com> | 2021-05-11 11:39:16 +0100 |
commit | 9b5442c16ec0d2c32d13b95e1cbd5b2b9dc8a7af (patch) | |
tree | 43454ff66cbaa0225422caccfae84af880f257ee | |
parent | 3f8bdf3f2cc8d536d57bd9c31932c6e2b310c618 (diff) | |
download | ghostpdl-9b5442c16ec0d2c32d13b95e1cbd5b2b9dc8a7af.tar.gz |
Handle CIDToGIDMaps in OTTO/CFF CIDFonts
-rw-r--r-- | pdf/pdf_font1C.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/pdf/pdf_font1C.c b/pdf/pdf_font1C.c index 7bc04dad8..6d0c1d0b6 100644 --- a/pdf/pdf_font1C.c +++ b/pdf/pdf_font1C.c @@ -1999,6 +1999,20 @@ pdfi_read_cff_font(pdf_context *ctx, pdf_dict *font_dict, byte *pfbuf, cffcid->FDArray = cffpriv.pdfcffpriv.FDArray; cffpriv.pdfcffpriv.FDArray = NULL; + cffcid->cidtogidmap.data = NULL; + cffcid->cidtogidmap.size = 0; + code = pdfi_dict_knownget(ctx, font_dict, "CIDToGIDMap", (pdf_obj **) &obj); + if (code > 0) { + /* CIDToGIDMap can only be a stream or a name, and if it's a name + it's only permitted to be "/Identity", so ignore it + */ + if (obj->type == PDF_STREAM) { + code = pdfi_stream_to_buffer(ctx, (pdf_stream *) obj, &(cffcid->cidtogidmap.data), (int64_t *) &(cffcid->cidtogidmap.size)); + } + pdfi_countdown(obj); + obj = NULL; + } + code = pdfi_dict_knownget_type(ctx, font_dict, "DW", PDF_INT, (pdf_obj **) &obj); if (code > 0) { cffcid->DW = ((pdf_num *) obj)->value.i; |