[truetype] Clean up.

* src/truetype/ttgload.c (TT_Process_Composite_Component): Use
`FT_Outline_Transform' and `FT_Outline_Translate'.
(translate_array): Dropped.
This commit is contained in:
Alexei Podtelezhnikov 2015-08-14 23:23:18 -04:00
parent d0d7ee047b
commit ae258aa088
2 changed files with 15 additions and 35 deletions

View File

@ -1,3 +1,11 @@
2015-08-14 Alexei Podtelezhnikov <apodtele@gmail.com>
[truetype] Clean up.
* src/truetype/ttgload.c (TT_Process_Composite_Component): Use
`FT_Outline_Transform' and `FT_Outline_Translate'.
(translate_array): Dropped.
2015-08-14 Andreas Enge <andreas.enge@inria.fr>
* builds/unix/detect.mk (CONFIG_SHELL): Don't handle it (#44261).

View File

@ -248,29 +248,6 @@
#endif /* FT_CONFIG_OPTION_INCREMENTAL */
/*************************************************************************/
/* */
/* Translates an array of coordinates. */
/* */
static void
translate_array( FT_UInt n,
FT_Vector* coords,
FT_Pos delta_x,
FT_Pos delta_y )
{
FT_UInt k;
if ( delta_x )
for ( k = 0; k < n; k++ )
coords[k].x += delta_x;
if ( delta_y )
for ( k = 0; k < n; k++ )
coords[k].y += delta_y;
}
/*************************************************************************/
/* */
/* The following functions are used by default with TrueType fonts. */
@ -1022,29 +999,26 @@
FT_UInt num_base_points )
{
FT_GlyphLoader gloader = loader->gloader;
FT_Vector* base_vec = gloader->base.outline.points;
FT_UInt num_points = (FT_UInt)gloader->base.outline.n_points;
FT_Outline current;
FT_Bool have_scale;
FT_Pos x, y;
current.points = gloader->base.outline.points + num_base_points;
current.n_points = gloader->base.outline.n_points - num_base_points;
have_scale = FT_BOOL( subglyph->flags & ( WE_HAVE_A_SCALE |
WE_HAVE_AN_XY_SCALE |
WE_HAVE_A_2X2 ) );
/* perform the transform required for this subglyph */
if ( have_scale )
{
FT_UInt i;
for ( i = num_base_points; i < num_points; i++ )
FT_Vector_Transform( base_vec + i, &subglyph->transform );
}
FT_Outline_Transform( &current, &subglyph->transform );
/* get offset */
if ( !( subglyph->flags & ARGS_ARE_XY_VALUES ) )
{
FT_UInt num_points = (FT_UInt)gloader->base.outline.n_points;
FT_UInt k = (FT_UInt)subglyph->arg1;
FT_UInt l = (FT_UInt)subglyph->arg2;
FT_Vector* p1;
@ -1149,9 +1123,7 @@
}
if ( x || y )
translate_array( num_points - num_base_points,
base_vec + num_base_points,
x, y );
FT_Outline_Translate( &current, x, y );
return FT_Err_Ok;
}