mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-13 04:27:47 -05:00
term: determine cell width from the width of the space character
This commit is contained in:
parent
6da88ddf01
commit
8dc9560431
1 changed files with 2 additions and 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);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue