summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmmanuele Bassi <ebassi@linux.intel.com>2011-12-05 11:43:48 +0000
committerEmmanuele Bassi <ebassi@linux.intel.com>2011-12-05 11:43:48 +0000
commit158245fda31e7adad38aa49e4c12efcad0e326e0 (patch)
treed57fe20164fc78048a8eebe653d2ca2741707d55
parent943a65b476431400bd0436e1be243a2917385866 (diff)
downloadclutter-158245fda31e7adad38aa49e4c12efcad0e326e0.tar.gz
backend: Fix em computation for non-absolute fonts
If a font description is not set to have an absolute size then we were using the wrong transformation for points to device units.
-rw-r--r--clutter/clutter-backend.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/clutter/clutter-backend.c b/clutter/clutter-backend.c
index b052d174b..a108fbb0d 100644
--- a/clutter/clutter-backend.c
+++ b/clutter/clutter-backend.c
@@ -176,14 +176,10 @@ get_units_per_em (ClutterBackend *backend,
if (is_absolute)
font_size = (gdouble) pango_size / PANGO_SCALE;
else
- font_size = (gdouble) pango_size / PANGO_SCALE
- * dpi
- / 96.0f;
+ font_size = dpi * ((gdouble) pango_size / PANGO_SCALE) / 72.0f;
/* 10 points at 96 DPI is 13.3 pixels */
- units_per_em = (1.2f * font_size)
- * dpi
- / 96.0f;
+ units_per_em = (1.2f * font_size) * dpi / 96.0f;
}
else
units_per_em = -1.0f;