mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-20 05:33:47 -04:00
config: letter-spacing: make this a relative value
0, the default, means no additional spacing; the cell width is defined by the font metrics. A positive value *adds* to the width from the font metrics, while a negative value *subtracts*.
This commit is contained in:
parent
389570b274
commit
70cfcf11fb
3 changed files with 21 additions and 7 deletions
|
|
@ -629,10 +629,11 @@ term_set_fonts(struct terminal *term, struct fcft_font *fonts[static 4])
|
|||
const int old_cell_width = term->cell_width;
|
||||
const int old_cell_height = term->cell_height;
|
||||
|
||||
term->cell_width = term->conf->letter_spacing >= 0
|
||||
? term->conf->letter_spacing
|
||||
: (term->fonts[0]->space_advance.x > 0
|
||||
? term->fonts[0]->space_advance.x : term->fonts[0]->max_advance.x);
|
||||
term->cell_width = (term->fonts[0]->space_advance.x > 0
|
||||
? term->fonts[0]->space_advance.x
|
||||
: term->fonts[0]->max_advance.x)
|
||||
+ term->conf->letter_spacing;
|
||||
|
||||
term->cell_height = term->conf->line_height >= 0
|
||||
? term->conf->line_height
|
||||
: max(term->fonts[0]->height,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue