summaryrefslogtreecommitdiff
path: root/Build/source/texk/xdvipdfmx/src/t1_load.c
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/texk/xdvipdfmx/src/t1_load.c')
-rw-r--r--Build/source/texk/xdvipdfmx/src/t1_load.c31
1 files changed, 20 insertions, 11 deletions
diff --git a/Build/source/texk/xdvipdfmx/src/t1_load.c b/Build/source/texk/xdvipdfmx/src/t1_load.c
index 5c05fefd2a3..d9c826e8b90 100644
--- a/Build/source/texk/xdvipdfmx/src/t1_load.c
+++ b/Build/source/texk/xdvipdfmx/src/t1_load.c
@@ -572,18 +572,24 @@ parse_subrs (cff_font *font,
}
if (mode != 1) {
- subrs = font->subrs[0] = cff_new_index(count);
- subrs->data = NEW(offset, card8);
- offset = 0;
- for (i = 0; i < count; i++) {
- subrs->offset[i] = offset + 1;
- if (lengths[i] > 0) {
- memcpy(subrs->data + offset, data + offsets[i], lengths[i]);
- offset += lengths[i];
+ if (font->subrs[0] == NULL) {
+ subrs = font->subrs[0] = cff_new_index(count);
+ subrs->data = NEW(offset, card8);
+ offset = 0;
+ for (i = 0; i < count; i++) {
+ subrs->offset[i] = offset + 1;
+ if (lengths[i] > 0) {
+ memcpy(subrs->data + offset, data + offsets[i], lengths[i]);
+ offset += lengths[i];
+ }
}
+ subrs->offset[count] = offset + 1;
+ } else {
+ /* Adobe's OPO_____.PFB and OPBO____.PFB have two /Subrs dicts,
+ * and also have /CharStrings not followed by dicts.
+ * Simply ignores those data. By ChoF on 2009/04/08. */
+ WARN("Already found /Subrs; ignores the other /Subrs dicts.");
}
- subrs->offset[count] = offset + 1;
-
RELEASE(data);
RELEASE(offsets);
RELEASE(lengths);
@@ -611,8 +617,11 @@ parse_charstrings (cff_font *font,
tok = pst_get_token(start, end);
if (!PST_INTEGERTYPE(tok) ||
pst_getIV(tok) < 0 || pst_getIV(tok) > CFF_GLYPH_MAX) {
+ unsigned char *s = pst_getSV(tok);
+ WARN("Ignores non dict \"/CharStrings %s ...\"", s);
+ RELEASE(s);
RELEASE_TOK(tok);
- return -1;
+ return 0;
}
count = pst_getIV(tok);
RELEASE_TOK(tok);