diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2017-11-20 19:15:59 +0100 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2017-11-23 10:53:51 +0100 |
commit | 55815c3b4f27cb977b4c7dabedcce65d463ff952 (patch) | |
tree | b9e3ae2f915ca08194c737532aef8bf0888b1aaa /source/pdf | |
parent | a05a5b462d9af5bd333b640079bf05c6bf3b6dce (diff) | |
download | mupdf-55815c3b4f27cb977b4c7dabedcce65d463ff952.tar.xz |
Workaround freetype synthesizing unicode cmaps.
Diffstat (limited to 'source/pdf')
-rw-r--r-- | source/pdf/pdf-font.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/source/pdf/pdf-font.c b/source/pdf/pdf-font.c index f3a48f2d..be69ce1c 100644 --- a/source/pdf/pdf-font.c +++ b/source/pdf/pdf-font.c @@ -598,15 +598,18 @@ select_truetype_cmap(FT_Face face, int symbolic) /* Then look for a Microsoft Unicode cmap */ for (i = 0; i < face->num_charmaps; i++) if (face->charmaps[i]->platform_id == 3 && face->charmaps[i]->encoding_id == 1) - return face->charmaps[i]; + if (FT_Get_CMap_Format(face->charmaps[i]) != -1) + return face->charmaps[i]; /* Finally look for an Apple MacRoman cmap */ for (i = 0; i < face->num_charmaps; i++) if (face->charmaps[i]->platform_id == 1 && face->charmaps[i]->encoding_id == 0) - return face->charmaps[i]; + if (FT_Get_CMap_Format(face->charmaps[i]) != -1) + return face->charmaps[i]; if (face->num_charmaps > 0) - return face->charmaps[0]; + if (FT_Get_CMap_Format(face->charmaps[0]) != -1) + return face->charmaps[0]; return NULL; } |