[gs-regression] Re: [gs-cvs] rev 8785 - trunk/gs/src - wrong log message

Igor V. Melichev igor.melichev at artifex.com
Wed May 28 15:12:35 PDT 2008


The patch 8785 has been committed with a damaged log message.
The damage happened due to "Far Manager version 1.70 (build 2087)" glitches 
on Vista 64.
The last but one line is broken.
Here is the correct message :

[beg quote]
Fix (True Type font loader) : Work around incorrect numGlyphs (continued).

DETAILS :

Bug 689516 "problem reading PDF: Failed to interpret TT instructions (ref 
7814)".
Bug 689866 "Regression: with TrueType fonts (possibly related to loca); file 
Bug688467.ps"

The last patch appears to cause a conflict with the revision 5707 change.
which introduced a heuristic for repairing fonts with unsorted loca.
When sorting the full loca (including glyphs behind numGlyps), the test 
cases
of bugs 688467 and 688461 cause overlapping glyphs,
so that the heuristic gives a wrong glyph length.

This patch improves the heuristic with checking the glyph length
obtained from the unsorted loca, and replaces it only if it looks incorrect.
Note the check includes an arbitrary condition for a glyph length,
which may need further adjustments.

EXPECTED DIFFERENCES :

None.
[end quote]

Unfortunately I don't have the SVN log correction script with me due to my 
office move.
I'll fix the log ASAP, or anybody else please do it and inform me.

Igor.



----- Original Message ----- 
From: <leonardo at ghostscript.com>
To: <gs-cvs at ghostscript.com>
Sent: Thursday, May 29, 2008 1:52 AM
Subject: [gs-cvs] rev 8785 - trunk/gs/src


> Author: leonardo
> Date: 2008-05-28 14:52:03 -0700 (Wed, 28 May 2008)
> New Revision: 8785
>
> Modified:
>   trunk/gs/src/gstype42.c
> Log:
> Fix (True Type font loader) : Work around incorrect numGlyphs (continued).
>
> DETAILS :
>
> Bug 689516 "problem reading PDF: Failed to interpret TT instructions (ref 
> 7814)".
> Bug 689866 "Regression: with TrueType fonts (possibly related to loca); 
> file Bug688467.ps"
>
> The last patch appears to cause a conflict with the revision 5707 change.
> which introduced a hewristic for reapring fonts with unsorted loca.
> When sortinmg the full loca (including glyphs behind numGlyps), the test 
> cases
> of bugs 688467 and 688461 cause overlapping glyphs,
> so that the hewristic gives a wrong glyph length.
>
> This patch improves the hewristic with checking the glyph length
> obtained from the unsorted loca, and replaces it only if it looks 
> incorrect.
> f
> which may need further adjustments.
>
> EXPECTED DIFFERENCES :
>
> None.
>
>
> Modified: trunk/gs/src/gstype42.c
> ===================================================================
> --- trunk/gs/src/gstype42.c 2008-05-28 18:16:26 UTC (rev 8784)
> +++ trunk/gs/src/gstype42.c 2008-05-28 21:52:03 UTC (rev 8785)
> @@ -108,6 +108,7 @@
> typedef struct gs_type42_font_init_sort_s {
>     ulong glyph_offset;
>     int glyph_num;
> +    int glyph_length;
> } gs_type42_font_init_sort_t;
> static int
> gs_type42_font_init_compare (const void *a, const void *b)
> @@ -307,6 +308,7 @@
>  */
>  ulong last_glyph_offset = glyph_size;
>  ulong num_valid_loca_elm = loca_size;
> + long last_offset = 0;
>  gs_type42_font_init_sort_t *psort;
>  gs_type42_font_init_sort_t *psortary =
>      (gs_type42_font_init_sort_t *)gs_alloc_byte_array(pfont->memory,
> @@ -314,18 +316,31 @@
>
>  if (psortary == 0)
>      return_error(gs_error_VMerror);
> - for (i = 0, psort = psortary; i < loca_size; i++, psort++) {
> + /* loca_size > 0 due to condition above, so we always have the 0th 
> element. */
> + psortary->glyph_num = 0;
> + psortary->glyph_offset = get_glyph_offset(pfont, 0);
> + for (i = 1, psort = psortary + 1; i < loca_size; i++, psort++) {
>      psort->glyph_num = i;
>      psort->glyph_offset = get_glyph_offset(pfont, i);
> -     }
> +     psort[-1].glyph_length = psort->glyph_offset - last_offset;
> +     last_offset = psort->glyph_offset;
> + }
> + psort[-1].glyph_length = 0; /* Dummy element. */
>  qsort(psortary, loca_size, sizeof(gs_type42_font_init_sort_t), 
> gs_type42_font_init_compare);
>  while (num_valid_loca_elm > 0 && psortary[num_valid_loca_elm - 
> 1].glyph_offset > glyph_size)
>      num_valid_loca_elm --;
>  if (0 == num_valid_loca_elm)
>      return_error(gs_error_invalidfont);
>  for (i = num_valid_loca_elm; i--;) {
> +     long old_length;
> +
>      psort = psortary + i;
> -     pfont->data.len_glyphs[psort->glyph_num] = last_glyph_offset - 
> psort->glyph_offset;
> +     old_length = psort->glyph_length;
> +     if (old_length < 0 || old_length > 2000 /*  arbitrary */) {
> + pfont->data.len_glyphs[psort->glyph_num] = last_glyph_offset - 
> psort->glyph_offset;
> + /* Note the new length may be so big as old_length. */
> +     } else
> + pfont->data.len_glyphs[psort->glyph_num] = old_length;
>      last_glyph_offset = psort->glyph_offset;
>  }
>  for (i = num_valid_loca_elm; i < loca_size; i++) {
>
> _______________________________________________
> gs-cvs mailing list
> gs-cvs at ghostscript.com
> http://www.ghostscript.com/mailman/listinfo/gs-cvs
> 



More information about the gs-regression mailing list