diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2013-05-01 13:49:31 +0200 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2013-05-01 13:50:16 +0200 |
commit | ae7b70dce175e02f5eab4b960267c8fba4a02b22 (patch) | |
tree | f6c3a213f9255cb072090c7548302f997dfbaf71 | |
parent | 01667aed31156e9cd93a2934ef79ec29898291ef (diff) | |
download | mupdf-ae7b70dce175e02f5eab4b960267c8fba4a02b22.tar.xz |
Try to use ToUnicode cmap to encode identity-encoded substitute fonts.
-rw-r--r-- | pdf/pdf_font.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/pdf/pdf_font.c b/pdf/pdf_font.c index b1621657..de43796f 100644 --- a/pdf/pdf_font.c +++ b/pdf/pdf_font.c @@ -868,6 +868,17 @@ load_cid_font(pdf_document *xref, pdf_obj *dict, pdf_obj *encoding, pdf_obj *to_ pdf_load_to_unicode(xref, fontdesc, NULL, collection, to_unicode); + /* If we have an identity encoding, we're supposed to use the glyph ids directly. + * If we only have a substitute font, that won't work. + * Make a last ditch attempt by using + * the ToUnicode table if it exists to map via the substitute font's cmap. */ + if (strstr(fontdesc->encoding->cmap_name, "Identity-") && fontdesc->font->ft_substitute) + { + fz_warn(ctx, "non-embedded font using identity encoding: %s", basefont); + if (fontdesc->to_unicode && !fontdesc->to_ttf_cmap) + fontdesc->to_ttf_cmap = pdf_keep_cmap(ctx, fontdesc->to_unicode); + } + /* Horizontal */ dw = 1000; |