From bc86cd61c75f984633eb226692a30832c58efb17 Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Tue, 26 Nov 2019 18:54:32 +0100 Subject: font: move metrics from terminal struct to font struct --- terminal.c | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) (limited to 'terminal.c') diff --git a/terminal.c b/terminal.c index a5c3f82c..b6c8beac 100644 --- a/terminal.c +++ b/terminal.c @@ -377,21 +377,6 @@ initialize_fonts(struct terminal *term, const struct config *conf) } tll_free(font_names); - - FT_Face ft_face = term->fonts[0]->face; - int max_x_advance = ft_face->size->metrics.max_advance / 64; - int height = ft_face->size->metrics.height / 64; - int descent = ft_face->size->metrics.descender / 64; - int ascent = ft_face->size->metrics.ascender / 64; - - term->fextents.height = height * term->fonts[0]->pixel_size_fixup; - term->fextents.descent = -descent * term->fonts[0]->pixel_size_fixup; - term->fextents.ascent = ascent * term->fonts[0]->pixel_size_fixup; - term->fextents.max_x_advance = max_x_advance * term->fonts[0]->pixel_size_fixup; - - LOG_DBG("metrics: height: %d, descent: %d, ascent: %d, x-advance: %d", - height, descent, ascent, max_x_advance); - return true; } @@ -529,8 +514,8 @@ term_init(const struct config *conf, struct fdm *fdm, struct wayland *wayl, goto err; /* Cell dimensions are based on the font metrics. Obviously */ - term->cell_width = (int)ceil(term->fextents.max_x_advance); - term->cell_height = (int)ceil(term->fextents.height); + term->cell_width = term->fonts[0]->max_x_advance; + term->cell_height = term->fonts[0]->height; LOG_INFO("cell width=%d, height=%d", term->cell_width, term->cell_height); /* Start the slave/client */ -- cgit v1.3