diff options
author | Khaled Hosny <khaledhosny@eglug.org> | 2014-07-27 23:04:53 +0000 |
---|---|---|
committer | Khaled Hosny <khaledhosny@eglug.org> | 2014-07-27 23:04:53 +0000 |
commit | 8637534bb66ab060136119b6e8e547c0f4e43ffe (patch) | |
tree | dea49c9fe826b11381ffb952497620e1e31de7b6 /Build/source/texk/dvipdfm-x/pdfdev.c | |
parent | 5795568a60dba76e57cdb78fda5aab4e6e135991 (diff) |
Fix reverse CMap lookup for ToUnicode map generation
git-svn-id: svn://tug.org/texlive/trunk@34744 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/dvipdfm-x/pdfdev.c')
-rw-r--r-- | Build/source/texk/dvipdfm-x/pdfdev.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Build/source/texk/dvipdfm-x/pdfdev.c b/Build/source/texk/dvipdfm-x/pdfdev.c index 6fa42237542..b7d2d9a5b82 100644 --- a/Build/source/texk/dvipdfm-x/pdfdev.c +++ b/Build/source/texk/dvipdfm-x/pdfdev.c @@ -463,6 +463,7 @@ struct dev_font { pdf_obj *resource; char *used_chars; + char *used_glyphs; /* Font format: * simple, composite or bitmap. @@ -876,6 +877,8 @@ dev_set_font (int font_id) if (!real_font->resource) { real_font->resource = pdf_get_font_reference(real_font->font_id); real_font->used_chars = pdf_get_font_usedchars(real_font->font_id); + if (real_font->cff_charsets) + real_font->used_glyphs = pdf_get_font_usedglyphs(real_font->font_id); } if (!real_font->used_on_this_page) { @@ -1155,6 +1158,11 @@ pdf_dev_set_string (spt_t xpos, spt_t ypos, length = instr_len; if (font->format == PDF_FONTTYPE_COMPOSITE) { + if (real_font->used_glyphs != NULL) { + for (i = 0; i < length; i += 2) + add_to_used_chars2(real_font->used_glyphs, + (unsigned short) (str_ptr[i] << 8)|str_ptr[i+1]); + } if (handle_multibyte_string(font, &str_ptr, &length, ctype) < 0) { ERROR("Error in converting input string..."); return; @@ -1536,6 +1544,7 @@ pdf_dev_locate_font (const char *font_name, spt_t ptsize) font->resource = NULL; /* Don't ref obj until font is actually used. */ font->used_chars = NULL; + font->used_glyphs = NULL; font->extend = 1.0; font->slant = 0.0; |