[clutter/clutter-1.8] backend: Fix em computation for non-absolute fonts
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [clutter/clutter-1.8] backend: Fix em computation for non-absolute fonts
- Date: Mon, 5 Dec 2011 11:46:51 +0000 (UTC)
commit 85a466268360ad007de90e34b24fa0f56692eaa8
Author: Emmanuele Bassi <ebassi linux intel com>
Date: Mon Dec 5 11:43:48 2011 +0000
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>
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;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]