summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Build/source/texk/dvipdfmx/ChangeLog5
-rw-r--r--Build/source/texk/dvipdfmx/src/tt_cmap.c14
-rw-r--r--Build/source/texk/xdvipdfmx/ChangeLog7
-rw-r--r--Build/source/texk/xdvipdfmx/src/tt_cmap.c14
4 files changed, 37 insertions, 3 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) {
diff --git a/Build/source/texk/xdvipdfmx/ChangeLog b/Build/source/texk/xdvipdfmx/ChangeLog
index a3a6f0fd505..bc07a99ee5d 100644
--- a/Build/source/texk/xdvipdfmx/ChangeLog
+++ b/Build/source/texk/xdvipdfmx/ChangeLog
@@ -1,4 +1,9 @@
-2012-12-11 Khaled Hosnt <khaledhosny@eglug.org>
+2012-12-12 Khaled Hosny <khaledhosny@eglug.org>
+
+ * src/tt_cmap.c: Make sure CMapName of embedded CMaps does not contain
+ slashes.
+
+2012-12-11 Khaled Hosny <khaledhosny@eglug.org>
* src/tt_cmap.c: Fix crash with fonts that has some glyphs without name
entries in 'post' table.
diff --git a/Build/source/texk/xdvipdfmx/src/tt_cmap.c b/Build/source/texk/xdvipdfmx/src/tt_cmap.c
index 1ac02796e43..04e101c100a 100644
--- a/Build/source/texk/xdvipdfmx/src/tt_cmap.c
+++ b/Build/source/texk/xdvipdfmx/src/tt_cmap.c
@@ -1079,6 +1079,7 @@ 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;
@@ -1086,8 +1087,19 @@ otf_create_ToUnicode_stream (const char *font_name,
struct tt_post_table *ttpost = NULL;
int i;
+ /* 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) {