diff options
author | Ken Sharp <ken.sharp@artifex.com> | 2022-12-14 12:59:49 +0000 |
---|---|---|
committer | Ken Sharp <ken.sharp@artifex.com> | 2022-12-14 12:59:49 +0000 |
commit | 181ac079eba8c2c1e68cb9538877782904941799 (patch) | |
tree | fa1938bf55511a53ad272a161be528fe79a1c0a2 /pdf/pdf_font0.c | |
parent | 1b653aa87cdb90c43dcde17a41741faa32c61a76 (diff) | |
download | ghostpdl-181ac079eba8c2c1e68cb9538877782904941799.tar.gz |
GhostPDF - warn if FontName missing from FontDescriptor
My test file GraphicAndText.pdf
We don't need the FontName in the FontDescriptor but the old interpreter
did an emitted a warning if it was missing.
Diffstat (limited to 'pdf/pdf_font0.c')
-rw-r--r-- | pdf/pdf_font0.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/pdf/pdf_font0.c b/pdf/pdf_font0.c index 76a94c8a4..51cf4989a 100644 --- a/pdf/pdf_font0.c +++ b/pdf/pdf_font0.c @@ -198,6 +198,15 @@ int pdfi_read_type0_font(pdf_context *ctx, pdf_dict *font_dict, pdf_dict *stream /* We're supposed to have a FontDescriptor, it can be missing, and we have to carry on */ (void)pdfi_dict_get(ctx, font_dict, "FontDescriptor", (pdf_obj **)&fontdesc); + if (fontdesc != NULL) { + pdf_obj *Name = NULL; + + code = pdfi_dict_get_type(ctx, (pdf_dict *) fontdesc, "FontName", PDF_NAME, (pdf_obj**)&Name); + if (code < 0) + pdfi_set_warning(ctx, 0, NULL, W_PDF_FDESC_BAD_FONTNAME, "pdfi_load_font", ""); + pdfi_countdown(Name); + } + code = pdfi_dict_get(ctx, font_dict, "Encoding", &cmap); if (code < 0) goto error; |