From e6e9110a8f094103f20c73a92f6172062dbd569f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Behdad=20Esfahbod=20=28=D8=A8=D9=87=D8=AF=D8=A7=D8=AF=20?= =?UTF-8?q?=D8=A7=D8=B3=D9=81=D9=87=D8=A8=D8=AF=29?= Date: Tue, 20 May 2025 16:51:25 -0600 Subject: [PATCH] * src/truetype/ttgxvar.c (ft_var_apply_tuple): Micro-optimize. --- src/truetype/ttgxvar.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/truetype/ttgxvar.c b/src/truetype/ttgxvar.c index 5c330136a..9a490a0c5 100644 --- a/src/truetype/ttgxvar.c +++ b/src/truetype/ttgxvar.c @@ -1896,16 +1896,24 @@ for ( i = 0; i < blend->num_axis; i++ ) { - FT_Fixed ncv = blend->normalizedcoords[i]; + FT_Fixed ncv; - FT_TRACE6(( " axis %d coordinate %.5f:\n", i, (double)ncv / 65536 )); - /* It's not clear why (for intermediate tuples) we don't need */ /* to check against start/end -- the documentation says we don't. */ /* Similarly, it's unclear why we don't need to scale along the */ /* axis. */ + if ( tuple_coords[i] == 0 ) + { + FT_TRACE6(( " tuple coordinate is zero, ignore\n" )); + continue; + } + + ncv = blend->normalizedcoords[i]; + + FT_TRACE6(( " axis %d coordinate %.5f:\n", i, (double)ncv / 65536 )); + if ( tuple_coords[i] == ncv ) { FT_TRACE6(( " tuple coordinate %.5f fits perfectly\n",