aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2010-02-11 20:44:35 -0600
committerTed Gould <ted@gould.cx>2010-02-11 20:44:35 -0600
commit78fa67257e72eb43d2a4f4d82d51f881af8ad91c (patch)
tree6823f2c6b80e23964912a809933236b8ad0b6048
parent5540e6c1c6321ec9c9d10060dc5917d842bcf08a (diff)
downloadayatana-indicator-session-78fa67257e72eb43d2a4f4d82d51f881af8ad91c.tar.gz
ayatana-indicator-session-78fa67257e72eb43d2a4f4d82d51f881af8ad91c.tar.bz2
ayatana-indicator-session-78fa67257e72eb43d2a4f4d82d51f881af8ad91c.zip
Calculating font size with PANGO_SCALE getting involved
-rw-r--r--src/indicator-session.c8
1 files changed, 4 insertions, 4 deletions
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);