aboutsummaryrefslogtreecommitdiff
path: root/terminal.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2019-11-26 17:54:32 +0000
committerDaniel Eklöf <daniel@ekloef.se>2019-11-26 18:02:35 +0000
commitbc86cd61c75f984633eb226692a30832c58efb17 (patch)
tree7acacdfbf567e52d5331bf7710557195d6800980 /terminal.c
parentfont: cleanup and return error when failing to load font file (diff)
font: move metrics from terminal struct to font struct
Diffstat (limited to 'terminal.c')
-rw-r--r--terminal.c19
1 files changed, 2 insertions, 17 deletions
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 */