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:46:26 +0000
commit85a466268360ad007de90e34b24fa0f56692eaa8 (patch)
treec6f86a3f30b9fbae74b03e8e7e285404f105156b
parent0e6e3a5d4b51331df8df5bebd60195fbcf5caec5 (diff)
downloadclutter-85a466268360ad007de90e34b24fa0f56692eaa8.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. (cherry picked from commit 158245fda31e7adad38aa49e4c12efcad0e326e0) Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
-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 8267544e8..db0a637fb 100644
--- a/clutter/clutter-backend.c
+++ b/clutter/clutter-backend.c
@@ -155,14 +155,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;