evolution r37474 - in trunk/widgets: . table text



Author: mbarnes
Date: Wed Mar 25 11:28:43 2009
New Revision: 37474
URL: http://svn.gnome.org/viewvc/evolution?rev=37474&view=rev

Log:
2009-03-25  Matthew Barnes  <mbarnes redhat com>

	** Fixes bug #576694

	* widgets/table/e-cell-text.c (build_layout):
	* widgets/text/e-text.c (reset_layout):
	Handle absolute font sizes correctly.



Modified:
   trunk/widgets/ChangeLog
   trunk/widgets/table/ChangeLog
   trunk/widgets/table/e-cell-text.c
   trunk/widgets/text/e-text.c

Modified: trunk/widgets/table/e-cell-text.c
==============================================================================
--- trunk/widgets/table/e-cell-text.c	(original)
+++ trunk/widgets/table/e-cell-text.c	Wed Mar 25 11:28:43 2009
@@ -593,16 +593,21 @@
 		PangoFontDescription *desc = NULL, *fixed_desc = NULL;
 		char *fixed_family = NULL;
 		gint fixed_size = 0;
+		gboolean fixed_points = TRUE;
 
 		fixed_desc = pango_font_description_from_string (ect->font_name);
 		if (fixed_desc) {
 			fixed_family = (char *)pango_font_description_get_family (fixed_desc);
 			fixed_size = pango_font_description_get_size (fixed_desc);
+			fixed_points = !pango_font_description_get_size_is_absolute (fixed_desc);
 		}
 
 		desc = pango_font_description_copy (gtk_widget_get_style (GTK_WIDGET (((GnomeCanvasItem *)ecell_view->e_table_item_view)->canvas))->font_desc);
 		pango_font_description_set_family (desc, fixed_family);
-		pango_font_description_set_size (desc, fixed_size);
+		if (fixed_points)
+			pango_font_description_set_size (desc, fixed_size);
+		else
+			pango_font_description_set_absolute_size (desc, fixed_size);
 /*  		pango_font_description_set_style (desc, PANGO_STYLE_OBLIQUE); */
 		pango_layout_set_font_description (layout, desc);
 		pango_font_description_free (desc);

Modified: trunk/widgets/text/e-text.c
==============================================================================
--- trunk/widgets/text/e-text.c	(original)
+++ trunk/widgets/text/e-text.c	Wed Mar 25 11:28:43 2009
@@ -426,8 +426,12 @@
 		pango_layout_context_changed (text->layout);
 
 		text->font_desc = pango_font_description_new ();
-		pango_font_description_set_size (text->font_desc,
-			pango_font_description_get_size ((GTK_WIDGET (item->canvas))->style->font_desc));
+		if (!pango_font_description_get_size_is_absolute ((GTK_WIDGET (item->canvas))->style->font_desc))
+			pango_font_description_set_size (text->font_desc,
+				pango_font_description_get_size ((GTK_WIDGET (item->canvas))->style->font_desc));
+		else
+			pango_font_description_set_absolute_size (text->font_desc,
+				pango_font_description_get_size ((GTK_WIDGET (item->canvas))->style->font_desc));
 		pango_font_description_set_family (text->font_desc,
 			pango_font_description_get_family ((GTK_WIDGET (item->canvas))->style->font_desc));
 		pango_layout_set_font_description (text->layout, text->font_desc);



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