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