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_font3.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_font3.c')
-rw-r--r-- | pdf/pdf_font3.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/pdf/pdf_font3.c b/pdf/pdf_font3.c index 17226ff06..34fba106b 100644 --- a/pdf/pdf_font3.c +++ b/pdf/pdf_font3.c @@ -258,6 +258,15 @@ int pdfi_read_type3_font(pdf_context *ctx, pdf_dict *font_dict, pdf_dict *stream if (code < 0) goto font3_error; + if (font->FontDescriptor != NULL) { + pdf_obj *Name = NULL; + + code = pdfi_dict_get_type(ctx, (pdf_dict *) font->FontDescriptor, "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); + } + pdfi_font_set_first_last_char(ctx, font_dict, (pdf_font *)font); /* ignore errors with widths... for now */ (void)pdfi_font_create_widths(ctx, font_dict, (pdf_font*)font, 1.0); |