hippo-canvas r7264 - trunk/common/hippo
- From: marco svn gnome org
- To: svn-commits-list gnome org
- Subject: hippo-canvas r7264 - trunk/common/hippo
- Date: Tue, 3 Jun 2008 13:56:24 +0000 (UTC)
Author: marco
Date: Tue Jun 3 13:56:24 2008
New Revision: 7264
URL: http://svn.gnome.org/viewvc/hippo-canvas?rev=7264&view=rev
Log:
Fix font size calculation, the units returned by cairo are scaled by PANGO_SCALE
Modified:
trunk/common/hippo/hippo-canvas-style.c
Modified: trunk/common/hippo/hippo-canvas-style.c
==============================================================================
--- trunk/common/hippo/hippo-canvas-style.c (original)
+++ trunk/common/hippo/hippo-canvas-style.c Tue Jun 3 13:56:24 2008
@@ -530,17 +530,20 @@
case FONT_RELATIVE:
{
PangoFontDescription *desc;
+ double font_size;
if (use_parent_font)
desc = get_parent_font(style);
else
desc = hippo_canvas_style_get_font(style);
-
+
+ font_size = (double)pango_font_description_get_size(desc) / PANGO_SCALE;
+
if (pango_font_description_get_size_is_absolute(desc)) {
- *length = num->val * multiplier * pango_font_description_get_size(desc);
+ *length = num->val * multiplier * font_size;
} else {
double resolution = hippo_canvas_context_get_resolution(style->context);
- *length = num->val * multiplier * (resolution / 72.) * pango_font_description_get_size(desc);
+ *length = num->val * multiplier * (resolution / 72.) * font_size;
}
}
break;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]