[goffice] Fix rich text size evaluation. [#679459]



commit 7c791a7c7562e2cce39fc15130b5fd4f69e92b6e
Author: Jean Brefort <jean brefort normalesup org>
Date:   Tue Jul 10 18:20:38 2012 +0200

    Fix rich text size evaluation. [#679459]

 ChangeLog                    |    7 +++++++
 NEWS                         |    3 +++
 goffice/graph/gog-label.c    |    4 ++--
 goffice/graph/gog-renderer.c |    6 ++++--
 4 files changed, 16 insertions(+), 4 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index c6791bb..2398444 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2012-07-10  Jean Brefort  <jean brefort normalesup org>
+
+	* goffice/graph/gog-label.c (gog_text_view_size_request),
+	(gog_text_view_render): fix use of rich text from GOData.
+	* goffice/graph/gog-renderer.c (gog_renderer_get_gostring_OBR): fix rich
+	text size evaluation. [#679459]
+
 2012-06-26 Andreas J. Guelzow <aguelzow pyrshep ca>
 
 	* goffice/graph/gog-reg-curve.c (limits_changed_cb): keep the
diff --git a/NEWS b/NEWS
index dd13af4..1fc65b8 100644
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,9 @@ Andreas:
 	* Fix spacing in chart properties dialog.
 	* Fix style inconsistency in regression trend line dialog. [#678810]
 
+Jean:
+	* Fix rich text size evaluation. [#679459]
+
 --------------------------------------------------------------------------
 goffice 0.9.4:
 
diff --git a/goffice/graph/gog-label.c b/goffice/graph/gog-label.c
index 270e2da..aeb4cdf 100644
--- a/goffice/graph/gog-label.c
+++ b/goffice/graph/gog-label.c
@@ -642,7 +642,7 @@ gog_text_view_size_request (GogView *v,
 {
 	GogText *text = GOG_TEXT (v->model);
 	char *str = gog_text_get_str (text);
-	PangoAttrList *pl = text->allow_markup? NULL: gog_text_get_markup (text);
+	PangoAttrList *pl = gog_text_get_markup (text);
 	GOGeometryAABR aabr;
 	double w = text->allow_wrap? available->w: -1.;
 
@@ -684,7 +684,7 @@ gog_text_view_render (GogView *view, GogViewAllocation const *bbox)
 	GogOutlinedObject *goo = GOG_OUTLINED_OBJECT (text);
 	GOStyle *style = text->base.base.style;
 	char *str = gog_text_get_str (text);
-	PangoAttrList *pl = text->allow_markup? NULL: gog_text_get_markup (text);
+	PangoAttrList *pl = gog_text_get_markup (text);
 	double w = text->allow_wrap? view->allocation.w: -1.;
 
 	gog_renderer_push_style (view->renderer, style);
diff --git a/goffice/graph/gog-renderer.c b/goffice/graph/gog-renderer.c
index 6d0793d..ea4be3b 100644
--- a/goffice/graph/gog-renderer.c
+++ b/goffice/graph/gog-renderer.c
@@ -978,7 +978,7 @@ gog_renderer_draw_text (GogRenderer *rend, char const *text,
 }
 
 /**
- * gog_renderer_get_text_OBR:
+ * gog_renderer_get_gostring_OBR:
  * @rend: #GogRenderer
  * @gostring: the string to draw
  * @obr: #GOGeometryOBR to store the Object Bounding Rectangle of @text.
@@ -1014,8 +1014,10 @@ gog_renderer_get_gostring_OBR (GogRenderer *rend, GOString *str,
 	if (max_width > 0)
 		pango_layout_set_width (layout, max_width * PANGO_SCALE / rend->scale);
 	attr = go_string_get_markup (str);
-	if (attr)
+	if (attr) {
 		pango_layout_set_attributes (layout, attr);
+		go_pango_translate_layout (layout);
+	}
 	pango_cairo_context_set_resolution (context, 72.0);
 	pango_layout_set_font_description (layout, style->font.font->desc);
 	pango_layout_get_extents (layout, NULL, &logical);



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