diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2019-12-05 18:34:47 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2019-12-05 18:34:47 +0000 |
| commit | 8dc956043158acb9fbabceb7a7f8d74f5c91a318 (patch) | |
| tree | 8b6d85700823a0819a83d06601ffe8c60596cb85 | |
| parent | config: trim leading spaces from fonts (diff) | |
term: determine cell width from the width of the space character
| -rw-r--r-- | terminal.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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); |
