[truetype] Clean up. * src/truetype/ttgload.c (TT_Process_Composite_Component): Use `FT_Outline_Transform' and `FT_Outline_Translate'. (translate_array): Dropped.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97
diff --git a/ChangeLog b/ChangeLog
index ea323f3..45196e0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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).
diff --git a/src/truetype/ttgload.c b/src/truetype/ttgload.c
index 38a25a5..61951b4 100644
--- a/src/truetype/ttgload.c
+++ b/src/truetype/ttgload.c
@@ -250,29 +250,6 @@
/*************************************************************************/
/* */
- /* 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. */
/* However, they can be replaced by alternatives if we need to support */
/* TrueType-compressed formats (like MicroType) in the future. */
@@ -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( ¤t, &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( ¤t, x, y );
return FT_Err_Ok;
}