diff options
author | Hironobu Yamashita <h.y.acetaminophen@gmail.com> | 2017-12-09 14:07:09 +0000 |
---|---|---|
committer | Hironobu Yamashita <h.y.acetaminophen@gmail.com> | 2017-12-09 14:07:09 +0000 |
commit | 9a03dd60f3227afcfd242b9633edbc0d83ffd02e (patch) | |
tree | f213ffadb2bf59b64015588ade7ad37a1d74b1ba /Build/source/texk/dvipdfm-x/tt_cmap.c | |
parent | fb0976eba4285e6fb42abd23bbe2e7a8fbf5563c (diff) |
dvipdfm-x/tt_cmap.c: import ToUnicode fix by jjgod
git-svn-id: svn://tug.org/texlive/trunk@46025 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/dvipdfm-x/tt_cmap.c')
-rw-r--r-- | Build/source/texk/dvipdfm-x/tt_cmap.c | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/Build/source/texk/dvipdfm-x/tt_cmap.c b/Build/source/texk/dvipdfm-x/tt_cmap.c index 38a8e15ea92..3ed64b681be 100644 --- a/Build/source/texk/dvipdfm-x/tt_cmap.c +++ b/Build/source/texk/dvipdfm-x/tt_cmap.c @@ -857,7 +857,9 @@ handle_CIDFont (sfnt *sfont, static int is_PUA_or_presentation (unsigned int uni) { - return ((uni >= 0xE000 && uni <= 0xF8FF) || (uni >= 0xFB00 && uni <= 0xFB4F) || + /* KANGXI RADICALs are commonly double encoded. */ + return ((uni >= 0x2F00 && uni <= 0x2FD5) || + (uni >= 0xE000 && uni <= 0xF8FF) || (uni >= 0xFB00 && uni <= 0xFB4F) || (uni >= 0xF0000 && uni <= 0xFFFFD) || (uni >= 0x100000 && uni <= 0x10FFFD)); } @@ -1019,7 +1021,13 @@ add_to_cmap_if_used (CMap *cmap, { USHORT count = 0; USHORT cid = cffont ? cff_charsets_lookup_inverse(cffont, gid) : gid; - if (is_used_char2(used_chars, cid)) { + + /* Skip PUA characters and alphabetic presentation forms, allowing + * handle_subst_glyphs() as it might find better mapping. Fixes the + * mapping of ligatures encoded in PUA in fonts like Linux Libertine + * and old Adobe fonts. + */ + if (is_used_char2(used_chars, cid) && !is_PUA_or_presentation(ch)) { int len; unsigned char *p = wbuf + 2; @@ -1030,18 +1038,11 @@ add_to_cmap_if_used (CMap *cmap, len = UC_UTF16BE_encode_char((int32_t) ch, &p, wbuf + WBUF_SIZE); CMap_add_bfchar(cmap, wbuf, 2, wbuf + 2, len); - /* Skip PUA characters and alphabetic presentation forms, allowing - * handle_subst_glyphs() as it might find better mapping. Fixes the - * mapping of ligatures encoded in PUA in fonts like Linux Libertine - * and old Adobe fonts. + /* Avoid duplicate entry + * There are problem when two Unicode code is mapped to + * single glyph... */ - if (!is_PUA_or_presentation(ch)) { - /* Avoid duplicate entry - * There are problem when two Unicode code is mapped to - * single glyph... - */ - used_chars[cid / 8] &= ~(1 << (7 - (cid % 8))); - } + used_chars[cid / 8] &= ~(1 << (7 - (cid % 8))); } return count; |