From 9a3d05d9804c36d4862ff705bd112f400903c222 Mon Sep 17 00:00:00 2001 From: Werner Lemberg Date: Wed, 26 Apr 2023 19:00:05 +0200 Subject: [PATCH] * src/ttgxvar.c: Minor changes. (TT_Get_MM_Var): Improve tracing messages. (tt_set_mm_blend): Minor speed-up. --- src/cff/cffload.c | 2 +- src/truetype/ttgxvar.c | 39 +++++++++++++++++++++------------------ 2 files changed, 22 insertions(+), 19 deletions(-) diff --git a/src/cff/cffload.c b/src/cff/cffload.c index fa2c29b28..a090111e3 100644 --- a/src/cff/cffload.c +++ b/src/cff/cffload.c @@ -1612,7 +1612,7 @@ FT_Service_MultiMasters mm = (FT_Service_MultiMasters)face->mm; - if (mm) + if ( mm ) mm->done_blend( FT_FACE( face ) ); } diff --git a/src/truetype/ttgxvar.c b/src/truetype/ttgxvar.c index 80553c93a..a50231a89 100644 --- a/src/truetype/ttgxvar.c +++ b/src/truetype/ttgxvar.c @@ -2544,7 +2544,7 @@ goto Exit; } - FT_TRACE5(( "%d instance%s\n", + FT_TRACE5(( "%d named instance%s\n", fvar_head.instanceCount, fvar_head.instanceCount == 1 ? "" : "s" )); @@ -2602,7 +2602,7 @@ (void)FT_STREAM_SEEK( pos ); - FT_TRACE5(( " instance %d (%s%s%s, %s%s%s)\n", + FT_TRACE5(( " named instance %d (%s%s%s, %s%s%s)\n", i, strname ? "name: `" : "", strname ? strname : "unnamed", @@ -2845,26 +2845,29 @@ } } - if ( FT_IS_NAMED_INSTANCE( FT_FACE( face ) ) ) + if ( !have_diff ) { - FT_UInt instance_index = (FT_UInt)face->root.face_index >> 16; + if ( FT_IS_NAMED_INSTANCE( FT_FACE( face ) ) ) + { + FT_UInt instance_index = (FT_UInt)face->root.face_index >> 16; - c = blend->normalizedcoords + i; - n = blend->normalized_stylecoords + - ( instance_index - 1 ) * mmvar->num_axis + - i; + c = blend->normalizedcoords + i; + n = blend->normalized_stylecoords + + ( instance_index - 1 ) * mmvar->num_axis + + i; - for ( j = i; j < mmvar->num_axis; j++, n++, c++ ) - if ( *c != *n ) - have_diff = 1; - } - else - { - c = blend->normalizedcoords + i; - for ( j = i; j < mmvar->num_axis; j++, c++ ) - if ( *c != 0 ) - have_diff = 1; + for ( j = i; j < mmvar->num_axis; j++, n++, c++ ) + if ( *c != *n ) + have_diff = 1; + } + else + { + c = blend->normalizedcoords + i; + for ( j = i; j < mmvar->num_axis; j++, c++ ) + if ( *c != 0 ) + have_diff = 1; + } } /* return value -1 indicates `no change' */