diff options
author | Nalin Dahyabhai <nalin@src.gnome.org> | 2003-04-24 18:17:17 +0000 |
---|---|---|
committer | Nalin Dahyabhai <nalin@src.gnome.org> | 2003-04-24 18:17:17 +0000 |
commit | ed1e60faf9bbcb50302a3348d01455c7b4c42826 (patch) | |
tree | 7e8ece0762bd4f30b9931ee8493e4d9b7efc2618 /src/vtexft.c | |
parent | fe43594cdd3e980af12be3f1a7b86b1ad8eea84a (diff) |
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.
Diffstat (limited to 'src/vtexft.c')
-rw-r--r-- | src/vtexft.c | 8 |
1 files changed, 4 insertions, 4 deletions
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); |