summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@gnu.org>2002-02-13 22:50:57 +0000
committerAnders Carlsson <andersca@src.gnome.org>2002-02-13 22:50:57 +0000
commit0ed0c3bab62f0f4233bbf235a2c02f20ca48ea94 (patch)
tree9390a806fbefd989164ad41589b4adb158520238 /src
parentc6ebcae729c45b832d471038b3b5356b90afee15 (diff)
downloadmetacity-0ed0c3bab62f0f4233bbf235a2c02f20ca48ea94.tar.gz
metacity-0ed0c3bab62f0f4233bbf235a2c02f20ca48ea94.tar.bz2
Use pango_context_get_metrics instead of loading the font.
2002-02-13 Anders Carlsson <andersca@gnu.org> * src/theme.c (meta_pango_font_desc_get_text_height): Use pango_context_get_metrics instead of loading the font.
Diffstat (limited to 'src')
-rw-r--r--src/theme.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/theme.c b/src/theme.c
index f241593..028db0d 100644
--- a/src/theme.c
+++ b/src/theme.c
@@ -4664,16 +4664,12 @@ meta_pango_font_desc_get_text_height (PangoFontDescription *font_desc,
PangoContext *context)
{
PangoFontMetrics *metrics;
- PangoFont *font;
PangoLanguage *lang;
int retval;
-
- font = pango_context_load_font (context, font_desc);
+
lang = pango_context_get_language (context);
- metrics = pango_font_get_metrics (font, lang);
-
- g_object_unref (G_OBJECT (font));
-
+ metrics = pango_context_get_metrics (context, font_desc, lang);
+
retval = PANGO_PIXELS (pango_font_metrics_get_ascent (metrics) +
pango_font_metrics_get_descent (metrics));