[sdf] Do not throw errors for invisible glyphs.

* src/sdf/ftsdfrend.c (ft_sdf_render, ft_bsdf_render): Return `FT_Err_Ok` if
width or height is zero, since some glyphs do not generate visible bitmaps.

Fixes #1150.
This commit is contained in:
Anuj Verma 2022-04-30 22:43:33 +05:30 committed by Werner Lemberg
parent 62bc04f4c5
commit 7b3ebb9c12
1 changed files with 4 additions and 14 deletions

View File

@ -298,15 +298,9 @@
goto Exit;
}
/* the rows and pitch must be valid after presetting the */
/* bitmap using outline */
/* nothing to render */
if ( !bitmap->rows || !bitmap->pitch )
{
FT_ERROR(( "ft_sdf_render: failed to preset bitmap\n" ));
error = FT_THROW( Cannot_Render_Glyph );
goto Exit;
}
return FT_Err_Ok;
/* the padding will simply be equal to the `spread' */
x_pad = sdf_module->spread;
@ -525,13 +519,9 @@
goto Exit;
}
/* nothing to render */
if ( !bitmap->rows || !bitmap->pitch )
{
FT_ERROR(( "ft_bsdf_render: invalid bitmap size\n" ));
error = FT_THROW( Invalid_Argument );
goto Exit;
}
return FT_Err_Ok;
FT_Bitmap_New( &target );