summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWerner Lemberg <wl@gnu.org>2019-05-07 10:09:55 +0200
committerWerner Lemberg <wl@gnu.org>2019-05-07 10:09:55 +0200
commitdc39f76cb7aecbefa3a601dd19e498eb903042fd (patch)
tree2b58baa97732f5c5e564be84887def7527248ac2
parent81725773800029731617b95cee57cd32a8b46756 (diff)
downloadfreetype2-dc39f76cb7aecbefa3a601dd19e498eb903042fd.tar.gz
* src/truetype/ttgxvar.c: More use of `FT_fdot14ToFixed'.
-rw-r--r--ChangeLog4
-rw-r--r--src/truetype/ttgxvar.c23
2 files changed, 15 insertions, 12 deletions
diff --git a/ChangeLog b/ChangeLog
index 7bf5ffdbb..44f62c82d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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>
* src/smooth/ftgrays.c (gray_render_line): Small shortcut.
diff --git a/src/truetype/ttgxvar.c b/src/truetype/ttgxvar.c
index 0b015b5e6..56b5b6d9f 100644
--- a/src/truetype/ttgxvar.c
+++ b/src/truetype/ttgxvar.c
@@ -397,9 +397,10 @@
for ( j = 0; j < segment->pairCount; j++ )
{
- /* convert to Fixed */
- segment->correspondence[j].fromCoord = FT_GET_SHORT() * 4;
- segment->correspondence[j].toCoord = FT_GET_SHORT() * 4;
+ segment->correspondence[j].fromCoord =
+ FT_fdot14ToFixed( FT_GET_SHORT() );
+ segment->correspondence[j].toCoord =
+ FT_fdot14ToFixed( FT_GET_SHORT() );
FT_TRACE5(( " mapping %.5f to %.5f\n",
segment->correspondence[j].fromCoord / 65536.0,
@@ -1616,7 +1617,7 @@
for ( j = 0; j < (FT_UInt)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 ",
blend->tuplecoords[i * gvar_head.axisCount + j] / 65536.0 ));
}
@@ -3266,8 +3267,7 @@
if ( tupleIndex & GX_TI_EMBEDDED_TUPLE_COORD )
{
for ( j = 0; j < blend->num_axis; j++ )
- tuple_coords[j] = FT_GET_SHORT() * 4; /* convert from */
- /* short frac to fixed */
+ tuple_coords[j] = FT_fdot14ToFixed( FT_GET_SHORT() );
}
else if ( ( tupleIndex & GX_TI_TUPLE_INDEX_MASK ) >= blend->tuplecount )
{
@@ -3298,9 +3298,9 @@
if ( tupleIndex & GX_TI_INTERMEDIATE_TUPLE )
{
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++ )
- im_end_coords[j] = FT_GET_SHORT() * 4;
+ im_end_coords[j] = FT_fdot14ToFixed( FT_GET_SHORT() );
}
apply = ft_var_apply_tuple( blend,
@@ -3812,8 +3812,7 @@
if ( tupleIndex & GX_TI_EMBEDDED_TUPLE_COORD )
{
for ( j = 0; j < blend->num_axis; j++ )
- tuple_coords[j] = FT_GET_SHORT() * 4; /* convert from */
- /* short frac to fixed */
+ tuple_coords[j] = FT_fdot14ToFixed( FT_GET_SHORT() );
}
else if ( ( tupleIndex & GX_TI_TUPLE_INDEX_MASK ) >= blend->tuplecount )
{
@@ -3833,9 +3832,9 @@
if ( tupleIndex & GX_TI_INTERMEDIATE_TUPLE )
{
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++ )
- im_end_coords[j] = FT_GET_SHORT() * 4;
+ im_end_coords[j] = FT_fdot14ToFixed( FT_GET_SHORT() );
}
apply = ft_var_apply_tuple( blend,