diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2016-04-25 12:36:59 +0200 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2016-04-26 15:12:57 +0200 |
commit | 34bf864107a499d55383ad5709082dbc2e2864df (patch) | |
tree | 97659d5e19c85ee39ccca9185057417de14e53f8 /source/pdf | |
parent | e9f53724a29616033b1c076a4bb99da9f82d98c8 (diff) | |
download | mupdf-34bf864107a499d55383ad5709082dbc2e2864df.tar.xz |
pdfcreate: Use industry font name for built-in fonts.
Diffstat (limited to 'source/pdf')
-rw-r--r-- | source/pdf/pdf-font.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/source/pdf/pdf-font.c b/source/pdf/pdf-font.c index ad4a29e9..be6644c2 100644 --- a/source/pdf/pdf-font.c +++ b/source/pdf/pdf-font.c @@ -2020,7 +2020,6 @@ pdf_add_simple_font(fz_context *ctx, pdf_document *doc, fz_font *font) pdf_font_desc *fontdesc = NULL; FT_Face face = font->ft_face; - const char *ps_name; unsigned char digest[16]; int first_char, last_char; @@ -2046,15 +2045,15 @@ pdf_add_simple_font(fz_context *ctx, pdf_document *doc, fz_font *font) case TYPE1: pdf_dict_put(ctx, fobj, PDF_NAME_Subtype, PDF_NAME_Type1); break; case TRUETYPE: pdf_dict_put(ctx, fobj, PDF_NAME_Subtype, PDF_NAME_TrueType); break; } - ps_name = FT_Get_Postscript_Name(face); - if (ps_name) - pdf_dict_put_drop(ctx, fobj, PDF_NAME_BaseFont, pdf_new_name(ctx, doc, ps_name)); - else - pdf_dict_put_drop(ctx, fobj, PDF_NAME_BaseFont, pdf_new_name(ctx, doc, font->name)); pdf_dict_put(ctx, fobj, PDF_NAME_Encoding, PDF_NAME_WinAnsiEncoding); if (!is_builtin_font(ctx, font)) { + const char *ps_name = FT_Get_Postscript_Name(face); + if (!ps_name) + ps_name = font->name; + pdf_dict_put_drop(ctx, fobj, PDF_NAME_BaseFont, pdf_new_name(ctx, doc, ps_name)); + fontdesc = pdf_new_font_desc(ctx); fontdesc->font = fz_keep_font(ctx, font); fontdesc->flags = PDF_FD_NONSYMBOLIC; /* ToDo: FixMe. Set non-symbolic always for now */ @@ -2070,6 +2069,10 @@ pdf_add_simple_font(fz_context *ctx, pdf_document *doc, fz_font *font) pdf_dict_put(ctx, fobj, PDF_NAME_Widths, fwidth_ref); pdf_dict_put(ctx, fobj, PDF_NAME_FontDescriptor, fdes_ref); } + else + { + pdf_dict_put_drop(ctx, fobj, PDF_NAME_BaseFont, pdf_new_name(ctx, doc, clean_font_name(font->name))); + } fref = pdf_add_object(ctx, doc, fobj); |