term: increase/decrease custom line-height with font size changes

When the user has set a custom line-height, we now adjust it when
increasing/decreasing (“zooming”) the font size at run-time.

Previously, the line-height was fixed at the size specified in
foot.ini.
This commit is contained in:
Daniel Eklöf 2021-03-20 15:32:31 +01:00
parent 57a663a0c7
commit 7609fbba47
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
4 changed files with 22 additions and 8 deletions

View file

@ -261,6 +261,12 @@ struct url {
};
typedef tll(struct url) url_list_t;
/* If px != 0 then px is valid, otherwise pt is valid */
struct pt_or_px {
int16_t px;
float pt;
};
struct terminal {
struct fdm *fdm;
struct reaper *reaper;
@ -312,6 +318,7 @@ struct terminal {
struct fcft_font *fonts[4];
struct config_font *font_sizes[4];
struct pt_or_px font_line_height;
float font_dpi;
int font_scale;
int16_t font_x_ofs;