Fix setting of named-instance to Regular

Fixes https://gitlab.freedesktop.org/freetype/freetype/-/issues/1341

And more elaborate avoidance of loading face->blend if all coords
are zero.
This commit is contained in:
Behdad Esfahbod 2025-05-31 15:57:41 -06:00 committed by Werner Lemberg
parent 320b72a295
commit cf06661c51

View file

@ -2942,11 +2942,15 @@
if ( !face->blend )
{
if ( !num_coords )
{
face->doblend = FALSE;
face->doblend = FALSE;
for ( i = 0; i < num_coords; i++ )
if ( coords[i] )
{
face->doblend = TRUE;
break;
}
if ( !face->doblend )
goto Exit;
}
if ( FT_SET_ERROR( TT_Get_MM_Var( FT_FACE( face ), NULL ) ) )
goto Exit;
@ -4294,15 +4298,18 @@
FT_Fixed* point_deltas_y = NULL;
if ( !face->doblend || !blend )
return FT_THROW( Invalid_Argument );
for ( i = 0; i < n_points; i++ )
{
unrounded[i].x = INT_TO_F26DOT6( outline->points[i].x );
unrounded[i].y = INT_TO_F26DOT6( outline->points[i].y );
}
if ( !face->doblend )
goto Exit;
if ( !blend )
return FT_THROW( Invalid_Argument );
if ( glyph_index >= blend->gv_glyphcnt ||
blend->glyphoffsets[glyph_index] ==
blend->glyphoffsets[glyph_index + 1] )