From 78fa67257e72eb43d2a4f4d82d51f881af8ad91c Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 11 Feb 2010 20:44:35 -0600 Subject: Calculating font size with PANGO_SCALE getting involved --- src/indicator-session.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/indicator-session.c') diff --git a/src/indicator-session.c b/src/indicator-session.c index c685203..f0232c6 100644 --- a/src/indicator-session.c +++ b/src/indicator-session.c @@ -181,17 +181,17 @@ switch_property_change (DbusmenuMenuitem * item, const gchar * property, const G pango_layout_set_text(layout, username, -1); pango_layout_set_font_description(layout, style->font_desc); - gint width, height; - pango_layout_get_pixel_size(layout, &width, &height); + gint width; + pango_layout_get_pixel_size(layout, &width, NULL); g_debug("Username width %dpx", width); gint point = pango_font_description_get_size(style->font_desc); - g_debug("Font size %d pt", point); + g_debug("Font size %f pt", (gfloat)point / PANGO_SCALE); gdouble dpi = gdk_screen_get_resolution(gdk_screen_get_default()); g_debug("Screen DPI %f", dpi); - gdouble pixels_per_em = point * dpi / 72.0f; + gdouble pixels_per_em = ((point * dpi) / 72.0f) / PANGO_SCALE; gdouble ems = width / pixels_per_em; g_debug("Username width %fem", ems); -- cgit v1.2.3