diff options
author | Jjgod Jiang <gzjjgod@gmail.com> | 2014-08-04 07:29:07 +0000 |
---|---|---|
committer | Jjgod Jiang <gzjjgod@gmail.com> | 2014-08-04 07:29:07 +0000 |
commit | 9e295194f1137856c64809a484b41306473d7a89 (patch) | |
tree | a0f9a63f20aa60fe06c216a40a1c75dae96551e8 /Build/source/texk/dvipdfm-x/tt_cmap.h | |
parent | e93685e85b3f0bff2eb571e79d77dccddd1cb2ed (diff) |
Fix ToUnicode with reverse CMap lookup
When dvipdfmx is provided a regular CMap in the following format:
<unicode codepoint> cid
We can try to utilize the data and do a reverse lookup when all we
know is the cids used.
Initially, when parsing the cmap specified, we build a reverseMap
which maps CID to the first Unicode codepoint it corresponds to.
(Which is pretty much the reverse of CMap_decode().)
Since this cmap is already parsed when we create the fontmap cache,
we can just pass the cmap_id all the way down to
otf_create_ToUnicode_stream() and get CMap* back from this cmap_id.
Second, we refactor create_ToUnicode_cmap{4, 12}() functions into
one create_ToUnicode_cmap() and combine the common code.
In the third step, in create_ToUnicode_cmap() we try to see if the
font is indeed a CFF font (with CID-keyed), and we do have a cmap,
we can use the newly added CMap_reverse_decode() to convert all
used cids back to Unicode codepoints. With that mapping information
we can successfully create the ToUnicode PDF stream we needed.
git-svn-id: svn://tug.org/texlive/trunk@34831 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/dvipdfm-x/tt_cmap.h')
-rw-r--r-- | Build/source/texk/dvipdfm-x/tt_cmap.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Build/source/texk/dvipdfm-x/tt_cmap.h b/Build/source/texk/dvipdfm-x/tt_cmap.h index 7aefdbf0ffc..afc492cb127 100644 --- a/Build/source/texk/dvipdfm-x/tt_cmap.h +++ b/Build/source/texk/dvipdfm-x/tt_cmap.h @@ -67,8 +67,9 @@ extern void tt_cmap_release (tt_cmap *cmap); /* Indirect reference */ extern pdf_obj *otf_create_ToUnicode_stream (const char *map_name, - int ttc_index, - const char *used_glyphs); + int ttc_index, + const char *used_glyphs, + int cmap_id); /* CMap ID */ extern int otf_load_Unicode_CMap (const char *map_name, int ttc_index, |