hippo-canvas r7271 - branches/hippo-canvas-0-2/common/hippo



Author: otaylor
Date: Mon Jun 16 14:37:57 2008
New Revision: 7271
URL: http://svn.gnome.org/viewvc/hippo-canvas?rev=7271&view=rev

Log:
Merge 7264 (marco)

Fix font size calculation, the units returned by cairo are scaled by PANGO_SCALE


Modified:
   branches/hippo-canvas-0-2/common/hippo/hippo-canvas-style.c

Modified: branches/hippo-canvas-0-2/common/hippo/hippo-canvas-style.c
==============================================================================
--- branches/hippo-canvas-0-2/common/hippo/hippo-canvas-style.c	(original)
+++ branches/hippo-canvas-0-2/common/hippo/hippo-canvas-style.c	Mon Jun 16 14:37:57 2008
@@ -415,17 +415,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]