mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-04-06 07:15:30 -04:00
term: use pt_or_px_as_pixels()
This commit is contained in:
parent
5ea37adaf4
commit
1830dfca55
1 changed files with 4 additions and 12 deletions
16
terminal.c
16
terminal.c
|
|
@ -644,23 +644,15 @@ term_set_fonts(struct terminal *term, struct fcft_font *fonts[static 4])
|
||||||
(term->fonts[0]->space_advance.x > 0
|
(term->fonts[0]->space_advance.x > 0
|
||||||
? term->fonts[0]->space_advance.x
|
? term->fonts[0]->space_advance.x
|
||||||
: term->fonts[0]->max_advance.x)
|
: term->fonts[0]->max_advance.x)
|
||||||
+ (conf->letter_spacing.px > 0
|
+ pt_or_px_as_pixels(term, &conf->letter_spacing);
|
||||||
? conf->letter_spacing.px
|
|
||||||
: conf->letter_spacing.pt * term->font_dpi / 72.);
|
|
||||||
|
|
||||||
term->cell_height = conf->line_height.px >= 0
|
term->cell_height = conf->line_height.px >= 0
|
||||||
? (conf->line_height.px > 0
|
? pt_or_px_as_pixels(term, &conf->line_height)
|
||||||
? conf->line_height.px
|
|
||||||
: conf->line_height.pt * term->font_dpi / 72.)
|
|
||||||
: max(term->fonts[0]->height,
|
: max(term->fonts[0]->height,
|
||||||
term->fonts[0]->ascent + term->fonts[0]->descent);
|
term->fonts[0]->ascent + term->fonts[0]->descent);
|
||||||
|
|
||||||
term->font_x_ofs = conf->horizontal_letter_offset.px > 0
|
term->font_x_ofs = pt_or_px_as_pixels(term, &conf->horizontal_letter_offset);
|
||||||
? conf->horizontal_letter_offset.px
|
term->font_y_ofs = pt_or_px_as_pixels(term, &conf->vertical_letter_offset);
|
||||||
: conf->horizontal_letter_offset.pt * term->font_dpi / 72.;
|
|
||||||
term->font_y_ofs = conf->vertical_letter_offset.px > 0
|
|
||||||
? conf->vertical_letter_offset.px
|
|
||||||
: conf->vertical_letter_offset.pt * term->font_dpi / 72.;
|
|
||||||
|
|
||||||
LOG_INFO("cell width=%d, height=%d", term->cell_width, term->cell_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