From 8dc956043158acb9fbabceb7a7f8d74f5c91a318 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Thu, 5 Dec 2019 19:34:47 +0100 Subject: [PATCH] term: determine cell width from the width of the space character --- terminal.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/terminal.c b/terminal.c index 922b28f8..f949aa8f 100644 --- a/terminal.c +++ b/terminal.c @@ -530,7 +530,8 @@ term_init(const struct config *conf, struct fdm *fdm, struct wayland *wayl, goto err; /* Cell dimensions are based on the font metrics. Obviously */ - term->cell_width = term->fonts[0]->max_x_advance; + term->cell_width = term->fonts[0]->space_x_advance > 0 + ? term->fonts[0]->space_x_advance : term->fonts[0]->max_x_advance; term->cell_height = term->fonts[0]->height; LOG_INFO("cell width=%d, height=%d", term->cell_width, term->cell_height);