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.
This commit is contained in:
parent
943a65b476
commit
158245fda3
@ -176,14 +176,10 @@ get_units_per_em (ClutterBackend *backend,
|
|||||||
if (is_absolute)
|
if (is_absolute)
|
||||||
font_size = (gdouble) pango_size / PANGO_SCALE;
|
font_size = (gdouble) pango_size / PANGO_SCALE;
|
||||||
else
|
else
|
||||||
font_size = (gdouble) pango_size / PANGO_SCALE
|
font_size = dpi * ((gdouble) pango_size / PANGO_SCALE) / 72.0f;
|
||||||
* dpi
|
|
||||||
/ 96.0f;
|
|
||||||
|
|
||||||
/* 10 points at 96 DPI is 13.3 pixels */
|
/* 10 points at 96 DPI is 13.3 pixels */
|
||||||
units_per_em = (1.2f * font_size)
|
units_per_em = (1.2f * font_size) * dpi / 96.0f;
|
||||||
* dpi
|
|
||||||
/ 96.0f;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
units_per_em = -1.0f;
|
units_per_em = -1.0f;
|
||||||
|
Loading…
Reference in New Issue
Block a user