diff options
-rw-r--r-- | Build/source/texk/web2c/pdftexdir/ChangeLog | 7 | ||||
-rw-r--r-- | Build/source/texk/web2c/pdftexdir/writet1.c | 23 |
2 files changed, 30 insertions, 0 deletions
diff --git a/Build/source/texk/web2c/pdftexdir/ChangeLog b/Build/source/texk/web2c/pdftexdir/ChangeLog index 4f3928b2d75..55984eef933 100644 --- a/Build/source/texk/web2c/pdftexdir/ChangeLog +++ b/Build/source/texk/web2c/pdftexdir/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-09-29 Peter Breitenlohner <peb@mppmu.mpg.de> * writeimg.c: Use png_get_*() instead of directly accessing diff --git a/Build/source/texk/web2c/pdftexdir/writet1.c b/Build/source/texk/web2c/pdftexdir/writet1.c index 65aacc05460..0f62e217f2c 100644 --- a/Build/source/texk/web2c/pdftexdir/writet1.c +++ b/Build/source/texk/web2c/pdftexdir/writet1.c @@ -1609,9 +1609,32 @@ static void t1_mark_glyphs(void) 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 |