* src/truetype/ttgxvar.c (TT_Vary_Apply_Glyph_Deltas): Thinko.

Don't apply deltas twice for non-phantom points.

Spotted by Ben Wagner.
This commit is contained in:
Werner Lemberg 2016-12-21 23:03:48 +01:00
parent e6a429e2c7
commit d44daf9e9b
4 changed files with 66 additions and 25 deletions

View File

@ -1,3 +1,11 @@
2016-12-21 Werner Lemberg <wl@gnu.org>
* src/truetype/ttgxvar.c (TT_Vary_Apply_Glyph_Deltas): Thinko.
Don't apply deltas twice for non-phantom points.
Spotted by Ben Wagner.
2016-12-21 Werner Lemberg <wl@gnu.org>
[cff, truetype] Another try for #49829.

View File

@ -417,17 +417,8 @@
globals->hb_buf = NULL;
#endif
globals->glyph_count = 0;
globals->stem_darkening_for_ppem = 0;
globals->darken_x = 0;
globals->darken_y = 0;
globals->standard_vertical_width = 0;
globals->standard_horizontal_width = 0;
globals->scale_down_factor = 0;
/* no need to free this one! */
globals->glyph_styles = NULL;
globals->face = NULL;
/* no need to free `globals->glyph_styles'; */
/* it is part of the `globals' array */
FT_FREE( globals );
}
}

View File

@ -140,6 +140,13 @@
error = service->set_mm_design( face, num_coords, coords );
}
/* enforce recomputation of auto-hinting data */
if ( !error && face->autohint.finalizer )
{
face->autohint.finalizer( face->autohint.data );
face->autohint.data = NULL;
}
return error;
}
@ -168,6 +175,13 @@
error = service->set_var_design( face, num_coords, coords );
}
/* enforce recomputation of auto-hinting data */
if ( !error && face->autohint.finalizer )
{
face->autohint.finalizer( face->autohint.data );
face->autohint.data = NULL;
}
return error;
}
@ -224,6 +238,13 @@
error = service->set_mm_blend( face, num_coords, coords );
}
/* enforce recomputation of auto-hinting data */
if ( !error && face->autohint.finalizer )
{
face->autohint.finalizer( face->autohint.data );
face->autohint.data = NULL;
}
return error;
}
@ -255,6 +276,13 @@
error = service->set_mm_blend( face, num_coords, coords );
}
/* enforce recomputation of auto-hinting data */
if ( !error && face->autohint.finalizer )
{
face->autohint.finalizer( face->autohint.data );
face->autohint.data = NULL;
}
return error;
}

View File

@ -2616,22 +2616,36 @@
FT_Pos delta_y = FT_MulFix( deltas_y[j], apply );
if ( j < n_points - 3 )
{
outline->points[j].x += delta_x;
outline->points[j].y += delta_y;
}
else
{
/* To avoid double adjustment of advance width or height, */
/* adjust phantom points only if there is no HVAR or VVAR */
/* table, respectively. */
if ( j != ( n_points - 3 ) ||
!( face->variation_support & TT_FACE_FLAG_VAR_HADVANCE ) )
outline->points[j].x += delta_x;
if ( j != ( n_points - 2 ) ||
!( face->variation_support & TT_FACE_FLAG_VAR_LSB ) )
/* support, respectively. */
if ( j == ( n_points - 3 ) ||
!( face->variation_support &
TT_FACE_FLAG_VAR_HADVANCE ) )
outline->points[j].x += delta_x;
if ( j != ( n_points - 1 ) ||
!( face->variation_support & TT_FACE_FLAG_VAR_VADVANCE ) )
else if ( j == ( n_points - 2 ) ||
!( face->variation_support &
TT_FACE_FLAG_VAR_LSB ) )
outline->points[j].x += delta_x;
else if ( j == ( n_points - 1 ) ||
!( face->variation_support &
TT_FACE_FLAG_VAR_VADVANCE ) )
outline->points[j].y += delta_y;
if ( j != ( n_points - 0 ) ||
!( face->variation_support & TT_FACE_FLAG_VAR_TSB ) )
else if ( j == ( n_points - 0 ) ||
!( face->variation_support &
TT_FACE_FLAG_VAR_TSB ) )
outline->points[j].y += delta_y;
}
#ifdef FT_DEBUG_LEVEL_TRACE
if ( delta_x || delta_y )