summaryrefslogtreecommitdiff
path: root/Build/source/texk/dvipdfm-x/cmap_p.h
diff options
context:
space:
mode:
authorJjgod Jiang <gzjjgod@gmail.com>2014-08-04 07:29:07 +0000
committerJjgod Jiang <gzjjgod@gmail.com>2014-08-04 07:29:07 +0000
commit9e295194f1137856c64809a484b41306473d7a89 (patch)
treea0f9a63f20aa60fe06c216a40a1c75dae96551e8 /Build/source/texk/dvipdfm-x/cmap_p.h
parente93685e85b3f0bff2eb571e79d77dccddd1cb2ed (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/cmap_p.h')
-rw-r--r--Build/source/texk/dvipdfm-x/cmap_p.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/Build/source/texk/dvipdfm-x/cmap_p.h b/Build/source/texk/dvipdfm-x/cmap_p.h
index 63639d2e3f7..7b9828bfbd3 100644
--- a/Build/source/texk/dvipdfm-x/cmap_p.h
+++ b/Build/source/texk/dvipdfm-x/cmap_p.h
@@ -97,6 +97,7 @@ struct CMap {
int maxBytesOut;
} profile;
+ int *reverseMap;
};
#endif /* _CMAP_P_H_ */