[ttgxvar] Fix caching of scalars when there are intermediate tuples.
For example, with `GoogleSansFlex-Regular.ttf` at ROND=100, the 'Q' glyph
was misrendering.
* src/truetype/ttgxvar.c (TT_Vary_Apply_Glyph_Deltas): Reset `tupleScalars`
earlier.
diff --git a/src/truetype/ttgxvar.c b/src/truetype/ttgxvar.c
index 9c011b3..267dcfe 100644
--- a/src/truetype/ttgxvar.c
+++ b/src/truetype/ttgxvar.c
@@ -4431,6 +4431,9 @@
tupleDataSize = FT_NEXT_USHORT( p );
tupleIndex = FT_NEXT_USHORT( p );
+ if ( tupleIndex & GX_TI_INTERMEDIATE_TUPLE )
+ tupleScalars = NULL;
+
if ( tupleIndex & GX_TI_EMBEDDED_TUPLE_COORD )
{
if ( 2 * blend->num_axis > (FT_UInt)( stream->limit - p ) )
@@ -4449,7 +4452,10 @@
}
else if ( ( tupleIndex & GX_TI_TUPLE_INDEX_MASK ) < blend->tuplecount )
{
- FT_Fixed scalar = tupleScalars[tupleIndex & GX_TI_TUPLE_INDEX_MASK];
+ FT_Fixed scalar =
+ tupleScalars
+ ? tupleScalars[tupleIndex & GX_TI_TUPLE_INDEX_MASK]
+ : (FT_Fixed)-0x20000;
if ( scalar != (FT_Fixed)-0x20000 )
@@ -4485,8 +4491,6 @@
im_start_coords[j] = FT_fdot14ToFixed( FT_NEXT_SHORT( p ) );
for ( j = 0; j < blend->num_axis; j++ )
im_end_coords[j] = FT_fdot14ToFixed( FT_NEXT_SHORT( p ) );
-
- tupleScalars = NULL;
}
apply = ft_var_apply_tuple( blend,