[goffice] Handle scale attributes in markup.



commit a0c4f735532eef4d6fe38ca2305fd8609f4fb7b0
Author: Andreas J. Guelzow <aguelzow pyrshep ca>
Date:   Fri May 29 01:56:39 2009 -0600

    Handle scale attributes in markup.
    
    2009-05-28  Andreas J. Guelzow  <aguelzow pyrshep ca>
    
    	* goffice/utils/go-format.c (cb_attrs_as_string): handle "scale"
    	  attributes
    	(go_format_parse_markup): ditto
---
 ChangeLog                 |    6 ++++++
 NEWS                      |    3 ++-
 goffice/utils/go-format.c |    6 ++++++
 3 files changed, 14 insertions(+), 1 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 180b436..3592555 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2009-05-28  Andreas J. Guelzow  <aguelzow pyrshep ca>
+
+	* goffice/utils/go-format.c (cb_attrs_as_string): handle "scale"
+	  attributes
+	(go_format_parse_markup): ditto
+
 2009-05-28  Morten Welinder  <terra gnome org>
 
 	* goffice/gtk/go-format-sel.c (struct _GOFormatSel): Use a
diff --git a/NEWS b/NEWS
index 05eb6e8..0595cec 100644
--- a/NEWS
+++ b/NEWS
@@ -1,7 +1,8 @@
 goffice 0.7.8:
 
 Andreas:
-	* Add some odf GOFormat output utilities.	
+	* Add some odf GOFormat output utilities.
+	* Handle scale attributes in markup.	
 
 Morten:
 	* Add functions to generate number formats.
diff --git a/goffice/utils/go-format.c b/goffice/utils/go-format.c
index 0e8e6da..6476611 100644
--- a/goffice/utils/go-format.c
+++ b/goffice/utils/go-format.c
@@ -4124,6 +4124,10 @@ cb_attrs_as_string (PangoAttribute *a, GString *accum)
 		g_string_append_printf (accum, "[rise=%d",
 			((PangoAttrInt *)a)->value);
 		break;
+	case PANGO_ATTR_SCALE:
+		g_string_append_printf (accum, "[scale=%.2f",
+			((PangoAttrFloat *)a)->value);
+		break;
 	case PANGO_ATTR_STYLE :
 		g_string_append_printf (accum, "[italic=%d",
 			(((PangoAttrInt *)a)->value == PANGO_STYLE_ITALIC) ? 1 : 0);
@@ -4218,6 +4222,8 @@ go_format_parse_markup (char *str)
 			if (0 == strncmp (str, "color", 5) &&
 			    3 == sscanf (val, "%02xx%02xx%02x", &r, &g, &b))
 				a = pango_attr_foreground_new ((r << 8) | r, (g << 8) | g, (b << 8) | b);
+			else if (0 == strncmp (str, "scale", 5))
+				a = pango_attr_scale_new (atof (val));
 			break;
 
 		case 6:



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