diff options
author | Chris Liddell <chris.liddell@artifex.com> | 2017-09-05 13:36:45 +0100 |
---|---|---|
committer | Chris Liddell <chris.liddell@artifex.com> | 2017-09-05 13:36:45 +0100 |
commit | 7dd033589ce40649ab602fba4c0473aa40c48439 (patch) | |
tree | 6757bf26f0c0e647b5e42e75345070f987d2ff27 /psi/zfapi.c | |
parent | f753769041467a1c88084d6d26c2755d7174691d (diff) | |
download | ghostpdl-7dd033589ce40649ab602fba4c0473aa40c48439.tar.gz |
Bug 698471: apply vertical substitute glyphs in TTF fonts
We weren't applying vertical glyph substition (from the gsub table).
Diffstat (limited to 'psi/zfapi.c')
-rw-r--r-- | psi/zfapi.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/psi/zfapi.c b/psi/zfapi.c index 01c705dd2..cabbd9109 100644 --- a/psi/zfapi.c +++ b/psi/zfapi.c @@ -1966,9 +1966,10 @@ ps_get_glyphname_or_cid(gs_text_enum_t *penum, else { ref *CIDSystemInfo; ref *Ordering; - ref *fdict, *CMapDict, *CMapName, CMapNameStr; + ref *fdict, *CMapDict, *CMapName, *WMode, CMapNameStr; char *cmapnm = NULL; int cmapnmlen = 0; + int wmode = 0; /* leave off the -H or -V */ const char * const utfcmap = "Identity-UTF16"; int utfcmaplen = strlen(utfcmap); @@ -1976,6 +1977,10 @@ ps_get_glyphname_or_cid(gs_text_enum_t *penum, fdict = pfont_dict(gs_rootfont(igs)); code = dict_find_string(fdict, "CMap", &CMapDict); if (code >= 0 && r_has_type(CMapDict, t_dictionary)) { + code = dict_find_string(CMapDict, "WMode", &WMode); + if (code >= 0 && r_has_type(WMode, t_integer)) { + wmode = WMode->value.intval; + } code = dict_find_string(CMapDict, "CMapName", &CMapName); if (code >= 0 && r_has_type(CMapName, t_name)) { name_string_ref(imemory, CMapName, &CMapNameStr); @@ -2010,6 +2015,8 @@ ps_get_glyphname_or_cid(gs_text_enum_t *penum, c = client_char_code; } } + if (pbfont->FontType == ft_CID_TrueType) + c = ((gs_font_cid2 *)pbfont)->data.substitute_glyph_index_vertical((gs_font_type42 *)pbfont, c, wmode, ccode); } if (pbfont->FontType == ft_CID_TrueType && c == 0 && TT_cmap) { ref cc32; |