From ed1e60faf9bbcb50302a3348d01455c7b4c42826 Mon Sep 17 00:00:00 2001 From: Nalin Dahyabhai Date: Thu, 24 Apr 2003 18:17:17 +0000 Subject: take an explicit XftFont instead of figuring out which one to use * src/vtexft.c(_vte_xft_char_width): take an explicit XftFont instead of figuring out which one to use ourselves. * src/vtexft.c(_vte_xft_draw_text): pass the XftFont which we're already using to _vte_xft_char_width to save a call to _vte_xft_font_for_char. --- src/vtexft.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/vtexft.c') diff --git a/src/vtexft.c b/src/vtexft.c index 56e75b8..a0dacf1 100644 --- a/src/vtexft.c +++ b/src/vtexft.c @@ -240,9 +240,8 @@ _vte_xft_font_for_char(struct _vte_xft_font *font, gunichar c) } static int -_vte_xft_char_width(struct _vte_xft_font *font, gunichar c) +_vte_xft_char_width(struct _vte_xft_font *font, XftFont *ftfont, gunichar c) { - XftFont *ftfont; XGlyphInfo extents; gpointer p = GINT_TO_POINTER(c); int i; @@ -267,7 +266,6 @@ _vte_xft_char_width(struct _vte_xft_font *font, gunichar c) } /* Compute and store the width. */ - ftfont = _vte_xft_font_for_char(font, c); memset(&extents, 0, sizeof(extents)); if (ftfont != NULL) { XftTextExtents32(GDK_DISPLAY(), ftfont, &c, 1, &extents); @@ -655,7 +653,9 @@ _vte_xft_draw_text(struct _vte_draw *draw, requests[i].c); if (specs[j].font != NULL) { specs[j].x = requests[i].x - data->x_offs; - width = _vte_xft_char_width(data->font, requests[i].c); + width = _vte_xft_char_width(data->font, + specs[j].font, + requests[i].c); if (width != 0) { pad = requests[i].columns * draw->width - width; pad = CLAMP(pad / 2, 0, draw->width); -- cgit v1.2.3