diff options
author | Khaled Hosny <khaledhosny@eglug.org> | 2012-12-12 00:06:53 +0000 |
---|---|---|
committer | Khaled Hosny <khaledhosny@eglug.org> | 2012-12-12 00:06:53 +0000 |
commit | a64f094828834d432a57434df4f4311dd7c114ac (patch) | |
tree | 7eb2b222b8c956e9b6d36c6bfa3aec75a73b9630 /Build/source/texk/dvipdfmx | |
parent | c7a00bf32b0701b32131d5710a7d6ca20b6212b9 (diff) |
Fix https://sourceforge.net/p/xetex/bugs/52/
git-svn-id: svn://tug.org/texlive/trunk@28504 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/dvipdfmx')
-rw-r--r-- | Build/source/texk/dvipdfmx/ChangeLog | 5 | ||||
-rw-r--r-- | Build/source/texk/dvipdfmx/src/tt_cmap.c | 14 |
2 files changed, 18 insertions, 1 deletions
diff --git a/Build/source/texk/dvipdfmx/ChangeLog b/Build/source/texk/dvipdfmx/ChangeLog index 4efa8ecfa55..d33a5faae00 100644 --- a/Build/source/texk/dvipdfmx/ChangeLog +++ b/Build/source/texk/dvipdfmx/ChangeLog @@ -1,3 +1,8 @@ +2012-12-12 Khaled Hosny <khaledhosny@eglug.org> + + * src/tt_cmap.c: Make sure CMapName of embedded CMaps does not contain + slashes. + 2012-09-24 Peter Breitenlohner <peb@mppmu.mpg.de> * version.ac (removed): We now maintain dvipdfmx here. diff --git a/Build/source/texk/dvipdfmx/src/tt_cmap.c b/Build/source/texk/dvipdfmx/src/tt_cmap.c index d2edcd48987..9cf95a83430 100644 --- a/Build/source/texk/dvipdfmx/src/tt_cmap.c +++ b/Build/source/texk/dvipdfmx/src/tt_cmap.c @@ -1028,14 +1028,26 @@ otf_create_ToUnicode_stream (const char *font_name, CMap *cmap_add; int cmap_add_id; tt_cmap *ttcmap; + char *normalized_font_name; char *cmap_name; FILE *fp = NULL; sfnt *sfont; long offset = 0; + /* replace slash in map name with dash to make the output cmap name valid, + * happens when XeTeX embeds full font path + * https://sourceforge.net/p/xetex/bugs/52/ + */ + normalized_font_name = NEW(strlen(font_name), char); + strcpy(normalized_font_name, font_name); + for (i = 0; i < strlen(font_name); ++i) { + if (normalized_font_name[i] == '/') + normalized_font_name[i] = '-'; + } + cmap_name = NEW(strlen(font_name)+strlen("-UTF16")+5, char); - sprintf(cmap_name, "%s,%03d-UTF16", font_name, ttc_index); + sprintf(cmap_name, "%s,%03d-UTF16", normalized_font_name, ttc_index); res_id = pdf_findresource("CMap", cmap_name); if (res_id >= 0) { |