summaryrefslogtreecommitdiff
path: root/Build/source/texk/xdvipdfmx/src/tt_cmap.c
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/texk/xdvipdfmx/src/tt_cmap.c')
-rw-r--r--Build/source/texk/xdvipdfmx/src/tt_cmap.c47
1 files changed, 26 insertions, 21 deletions
diff --git a/Build/source/texk/xdvipdfmx/src/tt_cmap.c b/Build/source/texk/xdvipdfmx/src/tt_cmap.c
index ea8fb0e304e..56076346993 100644
--- a/Build/source/texk/xdvipdfmx/src/tt_cmap.c
+++ b/Build/source/texk/xdvipdfmx/src/tt_cmap.c
@@ -1,4 +1,4 @@
-/* $Header: /home/cvsroot/dvipdfmx/src/tt_cmap.c,v 1.24 2005/07/08 14:18:05 hirata Exp $
+/* $Header: /home/cvsroot/dvipdfmx/src/tt_cmap.c,v 1.25 2007/04/13 06:48:03 chofchof Exp $
This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks.
@@ -521,7 +521,7 @@ tt_cmap_read (sfnt *sfont, USHORT platform, USHORT encoding)
cmap->map = read_cmap12(sfont, length);
break;
default:
- WARN("Unrecognized TrueType cmap format.");
+ WARN("Unrecognized OpenType/TrueType cmap format.");
tt_cmap_release(cmap);
return NULL;
}
@@ -557,7 +557,7 @@ tt_cmap_release (tt_cmap *cmap)
release_cmap12(cmap->map);
break;
default:
- ERROR("Unrecognized TrueType cmap format.");
+ ERROR("Unrecognized OpenType/TrueType cmap format.");
}
}
RELEASE(cmap);
@@ -575,7 +575,7 @@ tt_cmap_lookup (tt_cmap *cmap, long cc)
ASSERT(cmap);
if (cc > 0xffffL && cmap->format < 12) {
- WARN("Four bytes charcode not supported in TrueType cmap format 0...6.");
+ WARN("Four bytes charcode not supported in OpenType/TrueType cmap format 0...6.");
return 0;
}
@@ -596,7 +596,7 @@ tt_cmap_lookup (tt_cmap *cmap, long cc)
gid = lookup_cmap12(cmap->map, (ULONG) cc);
break;
default:
- ERROR("Unrecognized TrueType cmap subtable format");
+ ERROR("Unrecognized OpenType/TrueType cmap subtable format");
break;
}
@@ -889,6 +889,8 @@ handle_subst_glyphs (CMap *cmap,
for (k = 0; k < unicode_count; ++k) {
len += UC_sput_UTF16BE(unicodes[k], &p, wbuf+WBUF_SIZE);
}
+ wbuf[0] = (gid >> 8) & 0xff;
+ wbuf[1] = gid & 0xff;
CMap_add_bfchar(cmap, wbuf, 2, wbuf + 2, len);
}
}
@@ -1117,7 +1119,7 @@ otf_create_ToUnicode_stream (const char *font_name,
#endif
if (!sfont) {
- ERROR("Could not open TrueType font file \"%s\"", font_name);
+ ERROR("Could not open OpenType/TrueType font file \"%s\"", font_name);
}
switch (sfont->type) {
@@ -1133,7 +1135,7 @@ otf_create_ToUnicode_stream (const char *font_name,
}
if (sfnt_read_table_directory(sfont, offset) < 0) {
- ERROR("Could not read TrueType table directory.");
+ ERROR("Could not read OpenType/TrueType table directory.");
}
cmap_add_id = CMap_cache_find(cmap_name);
@@ -1162,7 +1164,7 @@ otf_create_ToUnicode_stream (const char *font_name,
}
}
if (cmap_obj == NULL)
- WARN("Unable to read TrueType Unicode cmap table.");
+ WARN("Unable to read OpenType/TrueType Unicode cmap table.");
tt_cmap_release(ttcmap);
CMap_set_silent(0);
@@ -1614,10 +1616,10 @@ handle_gsub (pdf_obj *conf,
rv = otl_gsub_select(gsub_list, script, language, feature);
if (rv < 0) {
if (flag == 'p') {
- WARN("No GSUB featre %s.%s.%s loaded...",
+ WARN("No GSUB feature %s.%s.%s loaded...",
script, language, feature);
} else if (flag == 'r') {
- ERROR("No GSUB featre %s.%s.%s loaded...",
+ ERROR("No GSUB feature %s.%s.%s loaded...",
script, language, feature);
}
} else {
@@ -1685,7 +1687,7 @@ fprintf(stderr, "otf_load_Unicode_CMap(%s, %d)\n", map_name, ttc_index);
sfont = sfnt_open(fp, -1);
#endif
if (!sfont) {
- ERROR("Could not open TrueType font file \"%s\"", map_name);
+ ERROR("Could not open OpenType/TrueType font file \"%s\"", map_name);
}
switch (sfont->type) {
case SFNT_TYPE_TTC:
@@ -1699,12 +1701,12 @@ fprintf(stderr, "otf_load_Unicode_CMap(%s, %d)\n", map_name, ttc_index);
offset = 0;
break;
default:
- ERROR("Not a TrueType/TTC font?: %s", map_name);
+ ERROR("Not a OpenType/TrueType/TTC font?: %s", map_name);
break;
}
if (sfnt_read_table_directory(sfont, offset) < 0)
- ERROR("Could not read TrueType table directory.");
+ ERROR("Could not read OpenType/TrueType table directory.");
base_name = NEW(strlen(map_name)+strlen("-UCS4-H")+5, char);
if (wmode)
@@ -1761,18 +1763,21 @@ fprintf(stderr, "otf_load_Unicode_CMap(%s, %d)\n", map_name, ttc_index);
return cmap_id;
}
- ttcmap = tt_cmap_read(sfont, 3, 10);
+ ttcmap = tt_cmap_read(sfont, 3, 10); /* Microsoft UCS4 */
if (!ttcmap) {
- ttcmap = tt_cmap_read(sfont, 3, 1);
- }
- if (!ttcmap) {
- ERROR("Unable to read TrueType Unicode cmap table.");
+ ttcmap = tt_cmap_read(sfont, 3, 1); /* Microsoft UCS2 */
+ if (!ttcmap) {
+ ttcmap = tt_cmap_read(sfont, 0, 3); /* Unicode 2.0 or later */
+ if (!ttcmap) {
+ ERROR("Unable to read OpenType/TrueType Unicode cmap table.");
+ }
+ }
}
cmap_id = load_base_CMap(base_name, wmode,
(is_cidfont ? &csi : NULL),
GIDToCIDMap, ttcmap);
if (cmap_id < 0)
- ERROR("Failed to read TrueType cmap table.");
+ ERROR("Failed to read OpenType/TrueType cmap table.");
if (!otl_tags) {
RELEASE(cmap_name);
@@ -1847,7 +1852,7 @@ fprintf(stderr, "otf_load_Unicode_CMap(%s, %d)\n", map_name, ttc_index);
}
opt_conf = otl_conf_find_opt(conf, opt_tag);
if (!opt_conf)
- ERROR("There are no option \"%s\" in \"%s\".",
+ ERROR("There is no option \"%s\" in \"%s\".",
opt_tag, conf_name);
load_gsub(opt_conf, gsub_list, sfont);
}
@@ -1858,7 +1863,7 @@ fprintf(stderr, "otf_load_Unicode_CMap(%s, %d)\n", map_name, ttc_index);
if (opt_tag) {
opt_conf = otl_conf_find_opt(conf, opt_tag);
if (!opt_conf)
- ERROR("There are no option \"%s\" in \"%s\".",
+ ERROR("There is no option \"%s\" in \"%s\".",
opt_tag, conf_name);
handle_gsub(opt_conf, ttcmap, gsub_list, &unencoded);
}