diff options
author | Behdad Esfahbod <behdad@behdad.org> | 2016-04-16 07:32:23 +0200 |
---|---|---|
committer | Werner Lemberg <wl@gnu.org> | 2016-04-16 07:32:23 +0200 |
commit | 99eff6782484fb7e08ef070e0e61ffec2a9c9dc8 (patch) | |
tree | c2f2273b138b8f8373f2105b6ec9d94aff889155 | |
parent | 213f0ca3e3cfda80d504c878d87a5d57f9a1f99f (diff) | |
download | freetype2-99eff6782484fb7e08ef070e0e61ffec2a9c9dc8.tar.gz |
[truetype] Another fix for non-intermediate GX tuples.
* src/truetype/ttgxvar.c (ft_var_apply_tuple): Add some missing
cases.
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | src/truetype/ttgxvar.c | 88 |
2 files changed, 60 insertions, 35 deletions
@@ -1,3 +1,10 @@ +2016-04-16 Behdad Esfahbod <behdad@behdad.org> + + [truetype] Another fix for non-intermediate GX tuples. + + * src/truetype/ttgxvar.c (ft_var_apply_tuple): Add some missing + cases. + 2016-04-12 Alexei Podtelezhnikov <apodtele@gmail.com> Remove forgotten macro. diff --git a/src/truetype/ttgxvar.c b/src/truetype/ttgxvar.c index ce4c8a0e7..9a02c5a8c 100644 --- a/src/truetype/ttgxvar.c +++ b/src/truetype/ttgxvar.c @@ -613,6 +613,11 @@ { FT_TRACE6(( " axis coordinate %d (%.4f):\n", i, blend->normalizedcoords[i] / 65536.0 )); + if ( !( tupleIndex & GX_TI_INTERMEDIATE_TUPLE ) ) + FT_TRACE6(( " intermediate coordinates %d (%.4f, %.4f):\n", + i, + im_start_coords[i] / 65536.0, + im_end_coords[i] / 65536.0 )); /* It's not clear why (for intermediate tuples) we don't need */ /* to check against start/end -- the documentation says we don't. */ @@ -625,61 +630,74 @@ continue; } - else if ( blend->normalizedcoords[i] == 0 ) + if ( blend->normalizedcoords[i] == 0 ) { FT_TRACE6(( " axis coordinate is zero, stop\n" )); apply = 0; break; } - else if ( ( blend->normalizedcoords[i] < FT_MIN( 0, tuple_coords[i] ) ) || - ( blend->normalizedcoords[i] > FT_MAX( 0, tuple_coords[i] ) ) ) + if ( blend->normalizedcoords[i] == tuple_coords[i] ) { - FT_TRACE6(( " tuple coordinate value %.4f is exceeded, stop\n", + FT_TRACE6(( " tuple coordinate value %.4f fits perfectly\n", tuple_coords[i] / 65536.0 )); - apply = 0; - break; + /* `apply' does not change */ + continue; } - else if ( !( tupleIndex & GX_TI_INTERMEDIATE_TUPLE ) ) + if ( !( tupleIndex & GX_TI_INTERMEDIATE_TUPLE ) ) { + /* not an intermediate tuple */ + + if ( blend->normalizedcoords[i] < FT_MIN( 0, tuple_coords[i] ) || + blend->normalizedcoords[i] > FT_MAX( 0, tuple_coords[i] ) ) + { + FT_TRACE6(( " tuple coordinate value %.4f is exceeded, stop\n", + tuple_coords[i] / 65536.0 )); + apply = 0; + break; + } + FT_TRACE6(( " tuple coordinate value %.4f fits\n", tuple_coords[i] / 65536.0 )); - /* not an intermediate tuple */ apply = FT_MulDiv( apply, blend->normalizedcoords[i], tuple_coords[i] ); } - - else if ( blend->normalizedcoords[i] < im_start_coords[i] || - blend->normalizedcoords[i] > im_end_coords[i] ) + else { - FT_TRACE6(( " intermediate tuple range [%.4f;%.4f] is exceeded," - " stop\n", - im_start_coords[i] / 65536.0, - im_end_coords[i] / 65536.0 )); - apply = 0; - break; - } + /* intermediate tuple */ - else if ( blend->normalizedcoords[i] < tuple_coords[i] ) - { - FT_TRACE6(( " intermediate tuple range [%.4f;%.4f] fits\n", - im_start_coords[i] / 65536.0, - im_end_coords[i] / 65536.0 )); - apply = FT_MulDiv( apply, - blend->normalizedcoords[i] - im_start_coords[i], - tuple_coords[i] - im_start_coords[i] ); - } + if ( blend->normalizedcoords[i] < im_start_coords[i] || + blend->normalizedcoords[i] > im_end_coords[i] ) + { + FT_TRACE6(( " intermediate tuple range [%.4f;%.4f] is exceeded," + " stop\n", + im_start_coords[i] / 65536.0, + im_end_coords[i] / 65536.0 )); + apply = 0; + break; + } - else - { - FT_TRACE6(( " intermediate tuple range [%.4f;%.4f] fits\n", - im_start_coords[i] / 65536.0, - im_end_coords[i] / 65536.0 )); - apply = FT_MulDiv( apply, - im_end_coords[i] - blend->normalizedcoords[i], - im_end_coords[i] - tuple_coords[i] ); + else if ( blend->normalizedcoords[i] < tuple_coords[i] ) + { + FT_TRACE6(( " intermediate tuple range [%.4f;%.4f] fits\n", + im_start_coords[i] / 65536.0, + im_end_coords[i] / 65536.0 )); + apply = FT_MulDiv( apply, + blend->normalizedcoords[i] - im_start_coords[i], + tuple_coords[i] - im_start_coords[i] ); + } + + else + { + FT_TRACE6(( " intermediate tuple range [%.4f;%.4f] fits\n", + im_start_coords[i] / 65536.0, + im_end_coords[i] / 65536.0 )); + apply = FT_MulDiv( apply, + im_end_coords[i] - blend->normalizedcoords[i], + im_end_coords[i] - tuple_coords[i] ); + } } } |