* src/truetype/ttgxvar.c: More use of `FT_fdot14ToFixed'.

This commit is contained in:
Werner Lemberg 2019-05-07 10:09:55 +02:00
parent 8172577380
commit dc39f76cb7
2 changed files with 15 additions and 12 deletions

View File

@ -1,3 +1,7 @@
2019-05-05 Werner Lemberg <wl@gnu.org>
* src/truetype/ttgxvar.c: More use of `FT_fdot14ToFixed'.
2019-05-04 Alexei Podtelezhnikov <apodtele@gmail.com> 2019-05-04 Alexei Podtelezhnikov <apodtele@gmail.com>
* src/smooth/ftgrays.c (gray_render_line): Small shortcut. * src/smooth/ftgrays.c (gray_render_line): Small shortcut.

View File

@ -397,9 +397,10 @@
for ( j = 0; j < segment->pairCount; j++ ) for ( j = 0; j < segment->pairCount; j++ )
{ {
/* convert to Fixed */ segment->correspondence[j].fromCoord =
segment->correspondence[j].fromCoord = FT_GET_SHORT() * 4; FT_fdot14ToFixed( FT_GET_SHORT() );
segment->correspondence[j].toCoord = FT_GET_SHORT() * 4; segment->correspondence[j].toCoord =
FT_fdot14ToFixed( FT_GET_SHORT() );
FT_TRACE5(( " mapping %.5f to %.5f\n", FT_TRACE5(( " mapping %.5f to %.5f\n",
segment->correspondence[j].fromCoord / 65536.0, segment->correspondence[j].fromCoord / 65536.0,
@ -1616,7 +1617,7 @@
for ( j = 0; j < (FT_UInt)gvar_head.axisCount; j++ ) for ( j = 0; j < (FT_UInt)gvar_head.axisCount; j++ )
{ {
blend->tuplecoords[i * gvar_head.axisCount + j] = blend->tuplecoords[i * gvar_head.axisCount + j] =
FT_GET_SHORT() * 4; /* convert to FT_Fixed */ FT_fdot14ToFixed( FT_GET_SHORT() );
FT_TRACE5(( "%.5f ", FT_TRACE5(( "%.5f ",
blend->tuplecoords[i * gvar_head.axisCount + j] / 65536.0 )); blend->tuplecoords[i * gvar_head.axisCount + j] / 65536.0 ));
} }
@ -3266,8 +3267,7 @@
if ( tupleIndex & GX_TI_EMBEDDED_TUPLE_COORD ) if ( tupleIndex & GX_TI_EMBEDDED_TUPLE_COORD )
{ {
for ( j = 0; j < blend->num_axis; j++ ) for ( j = 0; j < blend->num_axis; j++ )
tuple_coords[j] = FT_GET_SHORT() * 4; /* convert from */ tuple_coords[j] = FT_fdot14ToFixed( FT_GET_SHORT() );
/* short frac to fixed */
} }
else if ( ( tupleIndex & GX_TI_TUPLE_INDEX_MASK ) >= blend->tuplecount ) else if ( ( tupleIndex & GX_TI_TUPLE_INDEX_MASK ) >= blend->tuplecount )
{ {
@ -3298,9 +3298,9 @@
if ( tupleIndex & GX_TI_INTERMEDIATE_TUPLE ) if ( tupleIndex & GX_TI_INTERMEDIATE_TUPLE )
{ {
for ( j = 0; j < blend->num_axis; j++ ) for ( j = 0; j < blend->num_axis; j++ )
im_start_coords[j] = FT_GET_SHORT() * 4; im_start_coords[j] = FT_fdot14ToFixed( FT_GET_SHORT() );
for ( j = 0; j < blend->num_axis; j++ ) for ( j = 0; j < blend->num_axis; j++ )
im_end_coords[j] = FT_GET_SHORT() * 4; im_end_coords[j] = FT_fdot14ToFixed( FT_GET_SHORT() );
} }
apply = ft_var_apply_tuple( blend, apply = ft_var_apply_tuple( blend,
@ -3812,8 +3812,7 @@
if ( tupleIndex & GX_TI_EMBEDDED_TUPLE_COORD ) if ( tupleIndex & GX_TI_EMBEDDED_TUPLE_COORD )
{ {
for ( j = 0; j < blend->num_axis; j++ ) for ( j = 0; j < blend->num_axis; j++ )
tuple_coords[j] = FT_GET_SHORT() * 4; /* convert from */ tuple_coords[j] = FT_fdot14ToFixed( FT_GET_SHORT() );
/* short frac to fixed */
} }
else if ( ( tupleIndex & GX_TI_TUPLE_INDEX_MASK ) >= blend->tuplecount ) else if ( ( tupleIndex & GX_TI_TUPLE_INDEX_MASK ) >= blend->tuplecount )
{ {
@ -3833,9 +3832,9 @@
if ( tupleIndex & GX_TI_INTERMEDIATE_TUPLE ) if ( tupleIndex & GX_TI_INTERMEDIATE_TUPLE )
{ {
for ( j = 0; j < blend->num_axis; j++ ) for ( j = 0; j < blend->num_axis; j++ )
im_start_coords[j] = FT_GET_SHORT() * 4; im_start_coords[j] = FT_fdot14ToFixed( FT_GET_SHORT() );
for ( j = 0; j < blend->num_axis; j++ ) for ( j = 0; j < blend->num_axis; j++ )
im_end_coords[j] = FT_GET_SHORT() * 4; im_end_coords[j] = FT_fdot14ToFixed( FT_GET_SHORT() );
} }
apply = ft_var_apply_tuple( blend, apply = ft_var_apply_tuple( blend,