summaryrefslogtreecommitdiff
path: root/Build/source/texk/dvipdfmx
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/texk/dvipdfmx')
-rw-r--r--Build/source/texk/dvipdfmx/ChangeLog5
-rw-r--r--Build/source/texk/dvipdfmx/src/tt_cmap.c14
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) {