render: don't bother trying to lookup glyph for empty cells

Depending on the font, it may not have an entry for code point '0',
which will cause us to try to load fallback fonts.
This commit is contained in:
Daniel Eklöf 2020-01-12 01:19:41 +01:00
parent 36d0f1fa5f
commit 0b30316261
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -417,7 +417,8 @@ render_cell(struct terminal *term, pixman_image_t *pix,
}
struct font *font = attrs_to_font(term, &cell->attrs);
const struct glyph *glyph = font_glyph_for_wc(font, cell->wc);
const struct glyph *glyph = cell->wc != 0
? font_glyph_for_wc(font, cell->wc) : NULL;
int cell_cols = glyph != NULL ? max(1, glyph->cols) : 1;