From 158245fda31e7adad38aa49e4c12efcad0e326e0 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Mon, 5 Dec 2011 11:43:48 +0000 Subject: [PATCH] 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. --- clutter/clutter-backend.c | 8 ++------ 1 file 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;