summaryrefslogtreecommitdiff
path: root/Build/source/texk/xdvipdfmx/src/t1_load.c
diff options
context:
space:
mode:
authorJonathan Kew <jfkthame@googlemail.com>2006-12-14 16:15:20 +0000
committerJonathan Kew <jfkthame@googlemail.com>2006-12-14 16:15:20 +0000
commit7e95a2ea070baf92d1c8c7d50b4b1fb62aceb574 (patch)
treeb6b1ea378a47a16fdef0ec5f63ea45656d99b8c3 /Build/source/texk/xdvipdfmx/src/t1_load.c
parent108bac77f365b124be50b10dca56ed9fa4c29ed5 (diff)
merge dvipdfmx updates into xdvipdfmx
git-svn-id: svn://tug.org/texlive/trunk@2740 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/xdvipdfmx/src/t1_load.c')
-rw-r--r--Build/source/texk/xdvipdfmx/src/t1_load.c48
1 files changed, 35 insertions, 13 deletions
diff --git a/Build/source/texk/xdvipdfmx/src/t1_load.c b/Build/source/texk/xdvipdfmx/src/t1_load.c
index ccb09703351..100dfd6f794 100644
--- a/Build/source/texk/xdvipdfmx/src/t1_load.c
+++ b/Build/source/texk/xdvipdfmx/src/t1_load.c
@@ -1,4 +1,4 @@
-/* $Header: /home/cvsroot/dvipdfmx/src/t1_load.c,v 1.9 2005/07/17 09:53:38 hirata Exp $
+/* $Header: /home/cvsroot/dvipdfmx/src/t1_load.c,v 1.10 2006/12/06 12:52:43 chofchof Exp $
This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks.
@@ -645,19 +645,34 @@ parse_charstrings (cff_font *font,
char *glyph_name;
long len, gid, j;
- glyph_name = get_next_key(start, end);
- if (!glyph_name) {
- return -1;
- } else if (!strcmp(glyph_name, ".notdef")) {
- gid = 0;
- have_notdef = 1;
- } else if (have_notdef) {
- gid = i;
- } else if (i == count - 1) {
- WARN("No .notdef glyph???");
- return -1;
+ /* BUG-20061126 (by ChoF):
+ * Some fonts (e.g., belleek/blsy.pfb) does not have the correct number
+ * of glyphs. Modify the codes even to work with these broken fonts.
+ */
+ tok = pst_get_token(start, end);
+ glyph_name = (char *)pst_getSV(tok);
+
+ if (PST_NAMETYPE(tok)) {
+ RELEASE_TOK(tok);
+ if (!glyph_name) {
+ return -1;
+ } else if (!strcmp(glyph_name, ".notdef")) {
+ gid = 0;
+ have_notdef = 1;
+ } else if (have_notdef) {
+ gid = i;
+ } else if (i == count - 1) {
+ WARN("No .notdef glyph???");
+ return -1;
+ } else {
+ gid = i+1;
+ }
+ } else if (PST_UNKNOWNTYPE(tok) && !strcmp(glyph_name, "end")) {
+ RELEASE_TOK(tok);
+ break;
} else {
- gid = i+1;
+ RELEASE_TOK(tok);
+ return -1;
}
#ifdef XETEX
font->ft_to_gid[i] = gid;
@@ -738,6 +753,13 @@ parse_charstrings (cff_font *font,
}
}
*start += len;
+
+ tok = pst_get_token(start, end);
+ if (!MATCH_OP(tok, "ND") && !MATCH_OP(tok, "|-")) {
+ RELEASE_TOK(tok);
+ return -1;
+ }
+ RELEASE_TOK(tok);
}
if (mode != 1)
charstrings->offset[count] = offset + 1;