From 85a466268360ad007de90e34b24fa0f56692eaa8 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. (cherry picked from commit 158245fda31e7adad38aa49e4c12efcad0e326e0) Signed-off-by: Emmanuele Bassi --- clutter/clutter-backend.c | 8 ++------ 1 files changed, 2 insertions(+), 6 deletions(-) diff --git a/clutter/clutter-backend.c b/clutter/clutter-backend.c index 8267544..db0a637 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; -- 1.7.8.1