[truetype] Minor code beautification.

* src/truetype/ttgxvar.c (ft_var_to_normalized): Trace number of
design coordinates.
Simplify code.
This commit is contained in:
Matthias Clasen 2017-12-18 20:45:17 +01:00 committed by Werner Lemberg
parent 068a7a03aa
commit bdab6578af
2 changed files with 13 additions and 3 deletions

View File

@ -1,3 +1,11 @@
2017-12-18 Matthias Clasen <matthias.clasen@gmail.com>
[truetype] Minor code beautification.
* src/truetype/ttgxvar.c (ft_var_to_normalized): Trace number of
design coordinates.
Simplify code.
2017-12-18 Werner Lemberg <wl@gnu.org>
* src/*/*: Only use `ft_' and `FT_' variants of stdc library stuff.

View File

@ -1733,7 +1733,9 @@
/* based on the [min,def,max] values for the axis to be [-1,0,1]. */
/* Then, if there's an `avar' table, we renormalize this range. */
FT_TRACE5(( "design coordinates:\n" ));
FT_TRACE5(( "%d design coordinate%s:\n",
num_coords,
num_coords == 1 ? "" : "s" ));
a = mmvar->axis;
for ( i = 0; i < num_coords; i++, a++ )
@ -1758,10 +1760,10 @@
}
if ( coord < a->def )
normalized[i] = -FT_DivFix( coords[i] - a->def,
normalized[i] = -FT_DivFix( coord - a->def,
a->minimum - a->def );
else if ( coord > a->def )
normalized[i] = FT_DivFix( coords[i] - a->def,
normalized[i] = FT_DivFix( coord - a->def,
a->maximum - a->def );
else
normalized[i] = 0;