diff options
author | Karl Berry <karl@freefriends.org> | 2010-11-11 00:04:45 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2010-11-11 00:04:45 +0000 |
commit | cf0979efa1b7b3bbf368b9348e7cc2b35488cf40 (patch) | |
tree | 7ac87183c6829ebb60d3faab25f91f9453484f63 /Build/source/texk/dvipsk | |
parent | 1d6b73492f5dbd29e3ab705bf308b952991dbb04 (diff) |
handle number on different line than /CharStrings; report from DEK, fix from Thanh
git-svn-id: svn://tug.org/texlive/trunk@20399 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/dvipsk')
-rw-r--r-- | Build/source/texk/dvipsk/ChangeLog | 7 | ||||
-rw-r--r-- | Build/source/texk/dvipsk/writet1.c | 23 |
2 files changed, 30 insertions, 0 deletions
diff --git a/Build/source/texk/dvipsk/ChangeLog b/Build/source/texk/dvipsk/ChangeLog index 816926f56cd..31bd88d32d9 100644 --- a/Build/source/texk/dvipsk/ChangeLog +++ b/Build/source/texk/dvipsk/ChangeLog @@ -1,3 +1,10 @@ +2010-11-11 Thanh Han The <thanh@river-valley.org> + + * writet1.c (t1_check_unusual_charstring): new fn. + (t1_subset_charstrings): call it. This resolves a bug reported by + Knuth when there is a newline between the /CharStrings and the + following number (dict size). + 2010-10-23 Akira Kakuto <kakuto@fuk.kindai.ac.jp> * output.c (hvpos): simplify the change 2010-10-22. diff --git a/Build/source/texk/dvipsk/writet1.c b/Build/source/texk/dvipsk/writet1.c index a79a92cb5f4..5c4c44827e5 100644 --- a/Build/source/texk/dvipsk/writet1.c +++ b/Build/source/texk/dvipsk/writet1.c @@ -1417,9 +1417,32 @@ set_subr_max: subr_max = ptr - subr_tab; } +static void t1_check_unusual_charstring(void) +{ + char *p = strstr(t1_line_array, charstringname) + strlen(charstringname); + int i; + /* if no number follows "/CharStrings", let's read the next line */ + if (sscanf(p, "%i", &i) != 1) { + strcpy(t1_buf_array, t1_line_array); + t1_getline(); + strcat(t1_buf_array, t1_line_array); + strcpy(t1_line_array, t1_buf_array); + t1_line_ptr = eol(t1_line_array); + } +} + static void t1_subset_charstrings(void) { cs_entry *ptr; + + /* at this point t1_line_array contains "/CharStrings". + when we hit a case like this: + dup/CharStrings + 229 dict dup begin + we read the next line and concatenate to t1_line_array before moving on + */ + t1_check_unusual_charstring(); + cs_size_pos = strstr(t1_line_array, charstringname) + strlen(charstringname) - t1_line_array + 1; /* cs_size_pos points to the number indicating |