From 1830dfca55ff45398339ddd5493d55d02d990ab8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Thu, 7 Jan 2021 17:19:34 +0100 Subject: [PATCH] term: use pt_or_px_as_pixels() --- terminal.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/terminal.c b/terminal.c index a9c98ed5..a5537732 100644 --- a/terminal.c +++ b/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 : term->fonts[0]->max_advance.x) - + (conf->letter_spacing.px > 0 - ? conf->letter_spacing.px - : conf->letter_spacing.pt * term->font_dpi / 72.); + + pt_or_px_as_pixels(term, &conf->letter_spacing); term->cell_height = conf->line_height.px >= 0 - ? (conf->line_height.px > 0 - ? conf->line_height.px - : conf->line_height.pt * term->font_dpi / 72.) + ? pt_or_px_as_pixels(term, &conf->line_height) : max(term->fonts[0]->height, term->fonts[0]->ascent + term->fonts[0]->descent); - term->font_x_ofs = conf->horizontal_letter_offset.px > 0 - ? conf->horizontal_letter_offset.px - : 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.; + term->font_x_ofs = pt_or_px_as_pixels(term, &conf->horizontal_letter_offset); + term->font_y_ofs = pt_or_px_as_pixels(term, &conf->vertical_letter_offset); LOG_INFO("cell width=%d, height=%d", term->cell_width, term->cell_height);