summaryrefslogtreecommitdiff
path: root/pango/pangocairo-font.c
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@gnome.org>2006-02-01 03:36:14 +0000
committerBehdad Esfahbod <behdad@src.gnome.org>2006-02-01 03:36:14 +0000
commitc011f99bd0264f2567905ab610471aef37bf3325 (patch)
treeeea59be2beb461d3ff77af4083efcb7d20dcec23 /pango/pangocairo-font.c
parent2ce3c00370eef41bbb54a5b256987a4724020fa5 (diff)
downloadpango-c011f99bd0264f2567905ab610471aef37bf3325.tar.gz
Use cairo_scaled_font_text_extents instead of cairo_text_extents.
2006-01-31 Behdad Esfahbod <behdad@gnome.org> * pango/pangocairo-font.c (_pango_cairo_get_hex_box_info): Use cairo_scaled_font_text_extents instead of cairo_text_extents.
Diffstat (limited to 'pango/pangocairo-font.c')
-rw-r--r--pango/pangocairo-font.c15
1 files changed, 1 insertions, 14 deletions
diff --git a/pango/pangocairo-font.c b/pango/pangocairo-font.c
index a99676ac..d78dc6e4 100644
--- a/pango/pangocairo-font.c
+++ b/pango/pangocairo-font.c
@@ -132,8 +132,6 @@ _pango_cairo_get_hex_box_info (PangoCairoFont *cfont)
cairo_font_extents_t font_extents;
PangoFontDescription *mini_desc, *desc;
cairo_scaled_font_t *scaled_font, *scaled_mini_font;
- cairo_surface_t *surface;
- cairo_t *cr;
hbi = (PangoCairoHexBoxInfo *) g_object_get_data (G_OBJECT (cfont), "hex_box_info");
if (hbi)
@@ -212,27 +210,16 @@ _pango_cairo_get_hex_box_info (PangoCairoFont *cfont)
mini_cfont = (PangoCairoFont *) mini_font;
scaled_mini_font = _pango_cairo_font_get_scaled_font (mini_cfont);
- surface = cairo_image_surface_create (CAIRO_FORMAT_RGB24, 0, 0);
- cr = cairo_create (surface);
- _pango_cairo_font_install (mini_cfont, cr);
- cairo_surface_destroy (surface);
-
for (i = 0 ; i < 16 ; i++)
{
cairo_text_extents_t extents;
c[0] = hexdigits[i];
- /* The following call is being added into cairo. That's preferred way
- * to get the extents here. When turning that on, we can get rid of
- * the dummy surface and cairo context created above.
- */
- /* cairo_scaled_font_text_extents (scaled_mini_font, c, &extents); */
- cairo_text_extents (cr, c, &extents);
+ cairo_scaled_font_text_extents (scaled_mini_font, c, &extents);
width = MAX (width, extents.width);
height = MAX (height, extents.height);
}
- cairo_destroy (cr);
cairo_scaled_font_extents (scaled_font, &font_extents);
hbi = g_slice_new (PangoCairoHexBoxInfo);