summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Liddell <chris.liddell@artifex.com>2021-05-10 18:26:53 +0100
committerChris Liddell <chris.liddell@artifex.com>2021-05-11 11:39:16 +0100
commit9b5442c16ec0d2c32d13b95e1cbd5b2b9dc8a7af (patch)
tree43454ff66cbaa0225422caccfae84af880f257ee
parent3f8bdf3f2cc8d536d57bd9c31932c6e2b310c618 (diff)
downloadghostpdl-9b5442c16ec0d2c32d13b95e1cbd5b2b9dc8a7af.tar.gz
Handle CIDToGIDMaps in OTTO/CFF CIDFonts
-rw-r--r--pdf/pdf_font1C.c14
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;