* src/sfnt/ttsbit.c (tt_face_load_sbix_image): Respect metrics_only.

Also fixes recursive flip.
This commit is contained in:
Alexei Podtelezhnikov 2024-09-07 13:44:57 -04:00
parent 3008032062
commit 83af801b55
1 changed files with 4 additions and 4 deletions

View File

@ -1467,8 +1467,8 @@
FT_Error error; FT_Error error;
FT_Byte* p; FT_Byte* p;
FT_UNUSED( map );
#ifndef FT_CONFIG_OPTION_USE_PNG #ifndef FT_CONFIG_OPTION_USE_PNG
FT_UNUSED( map );
FT_UNUSED( metrics_only ); FT_UNUSED( metrics_only );
#endif #endif
@ -1527,7 +1527,7 @@
recurse_depth++; recurse_depth++;
if ( graphicType == FT_MAKE_TAG( 'f', 'l', 'i', 'p' ) ) if ( graphicType == FT_MAKE_TAG( 'f', 'l', 'i', 'p' ) )
flipped = TRUE; flipped = !flipped;
goto retry; goto retry;
} }
@ -1546,7 +1546,7 @@
glyph_end - glyph_start - 8, glyph_end - glyph_start - 8,
TRUE, TRUE,
metrics_only ); metrics_only );
if ( !error && flipped ) if ( flipped && !metrics_only && !error )
{ {
FT_UInt32* curr_pos = (FT_UInt32*)map->buffer; FT_UInt32* curr_pos = (FT_UInt32*)map->buffer;
@ -1562,7 +1562,7 @@
FT_UInt32* right = curr_pos + width - 1; FT_UInt32* right = curr_pos + width - 1;
while( left < right ) while ( left < right )
{ {
FT_UInt32 value; FT_UInt32 value;