mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-22 05:33:45 -04:00
font: don't bother creating a cairo surface for zero-width glyphs
This commit is contained in:
parent
8035bbfbdb
commit
9e7106018e
1 changed files with 4 additions and 1 deletions
3
font.c
3
font.c
|
|
@ -364,6 +364,9 @@ glyph_for_wchar(struct font *font, wchar_t wc, struct glyph *glyph)
|
||||||
bitmap->pixel_mode == FT_PIXEL_MODE_GRAY ||
|
bitmap->pixel_mode == FT_PIXEL_MODE_GRAY ||
|
||||||
bitmap->pixel_mode == FT_PIXEL_MODE_BGRA);
|
bitmap->pixel_mode == FT_PIXEL_MODE_BGRA);
|
||||||
|
|
||||||
|
if (bitmap->width == 0)
|
||||||
|
goto err;
|
||||||
|
|
||||||
/* Map FT pixel format to cairo surface format */
|
/* Map FT pixel format to cairo surface format */
|
||||||
cairo_format_t cr_format =
|
cairo_format_t cr_format =
|
||||||
bitmap->pixel_mode == FT_PIXEL_MODE_MONO ? CAIRO_FORMAT_A1 :
|
bitmap->pixel_mode == FT_PIXEL_MODE_MONO ? CAIRO_FORMAT_A1 :
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue