mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-04-04 07:15:29 -04:00
config: line-height, letter-spacing: values are in pt by default, but we allow px
If the value is specified without a unit, then the value is assumed to be in points, subject to DPI scaling. The value can optionally have a ‘px’ suffix, in which case the value is treated as a raw pixel count.
This commit is contained in:
parent
4c9f593d91
commit
a6fc8b5da4
6 changed files with 97 additions and 61 deletions
14
config.h
14
config.h
|
|
@ -54,6 +54,12 @@ struct config_mouse_binding {
|
|||
} pipe;
|
||||
};
|
||||
|
||||
/* If px == -1, neither px nor pt is valid. If px == 0, pt is valid, else px */
|
||||
union pt_or_px {
|
||||
int16_t px;
|
||||
float pt;
|
||||
};
|
||||
|
||||
struct config {
|
||||
char *term;
|
||||
char *shell;
|
||||
|
|
@ -85,12 +91,12 @@ struct config {
|
|||
config_font_list_t fonts[4];
|
||||
|
||||
/* Custom font metrics (-1 = use real font metrics) */
|
||||
int16_t line_height;
|
||||
int16_t letter_spacing;
|
||||
union pt_or_px line_height;
|
||||
union pt_or_px letter_spacing;
|
||||
|
||||
/* Adjusted letter x/y offsets */
|
||||
int16_t horizontal_letter_offset;
|
||||
int16_t vertical_letter_offset;
|
||||
union pt_or_px horizontal_letter_offset;
|
||||
union pt_or_px vertical_letter_offset;
|
||||
|
||||
struct {
|
||||
int lines;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue