mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-11 05:33:55 -04:00
config: add underline-offset option
This option allows the user to configure a custom underline offset. That is, use the user provided offset instead of the font provided one. Closes #490
This commit is contained in:
parent
11829931a7
commit
cf81fff062
6 changed files with 42 additions and 9 deletions
17
config.c
17
config.c
|
|
@ -793,6 +793,14 @@ parse_section_main(const char *key, const char *value, struct config *conf,
|
|||
return false;
|
||||
}
|
||||
|
||||
else if (strcmp(key, "underline-offset") == 0) {
|
||||
if (!str_to_pt_or_px(
|
||||
value, &conf->underline_offset,
|
||||
conf, path, lineno, "default", "underline-offset"))
|
||||
return false;
|
||||
conf->use_custom_underline_offset = true;
|
||||
}
|
||||
|
||||
else if (strcmp(key, "dpi-aware") == 0) {
|
||||
if (strcmp(value, "auto") == 0)
|
||||
conf->dpi_aware = DPI_AWARE_AUTO;
|
||||
|
|
@ -2514,10 +2522,11 @@ config_load(struct config *conf, const char *conf_path,
|
|||
},
|
||||
.startup_mode = STARTUP_WINDOWED,
|
||||
.fonts = {tll_init(), tll_init(), tll_init(), tll_init()},
|
||||
.line_height = { .pt = 0, .px = -1, },
|
||||
.letter_spacing = { .pt = 0, .px = 0, },
|
||||
.horizontal_letter_offset = {.pt = 0, .px = 0, },
|
||||
.vertical_letter_offset = {.pt = 0, .px = 0, },
|
||||
.line_height = {.pt = 0, .px = -1},
|
||||
.letter_spacing = {.pt = 0, .px = 0},
|
||||
.horizontal_letter_offset = {.pt = 0, .px = 0},
|
||||
.vertical_letter_offset = {.pt = 0, .px = 0},
|
||||
.use_custom_underline_offset = false,
|
||||
.box_drawings_uses_font_glyphs = false,
|
||||
.dpi_aware = DPI_AWARE_AUTO, /* DPI-aware when scaling-factor == 1 */
|
||||
.bell = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue