dia r4000 - in trunk: . lib



Author: hans
Date: Sat May 10 13:35:34 2008
New Revision: 4000
URL: http://svn.gnome.org/viewvc/dia?rev=4000&view=rev

Log:
2008-05-10  Hans Breuer  <hans breuer org>

	* lib/font.c(dia_font_get_sizes) : use the maximum width of logical-
	and ink-rect to make the always glyphs fit the bounding box. Probably
	fixes bug #455651 but needs checking with DiaRenderer using Freetype.



Modified:
   trunk/ChangeLog
   trunk/lib/font.c

Modified: trunk/lib/font.c
==============================================================================
--- trunk/lib/font.c	(original)
+++ trunk/lib/font.c	Sat May 10 13:35:34 2008
@@ -745,6 +745,9 @@
     pango_layout_iter_get_line_extents(iter, &more_ink_rect, &more_logical_rect);
     if (more_logical_rect.width > logical_rect.width)
       logical_rect.width = more_logical_rect.width;
+    /* also calculate for the ink rect (true space needed for drawing the glyphs) */
+    if (more_ink_rect.width > ink_rect.width)
+      ink_rect.width = more_ink_rect.width;
   }
 
   pango_layout_iter_free(iter);
@@ -755,7 +758,8 @@
   if (non_empty_string != string) {
     *width = 0.0;
   } else {
-    *width = pdu_to_dcm(logical_rect.width) / 20;
+    /* take the bigger rectangle to avoid cutting of any part of the string */
+    *width = pdu_to_dcm(logical_rect.width > ink_rect.width ? logical_rect.width : ink_rect.width) / 20;
   }
   return offsets;
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]