[gnumeric] xslx: import font family name.
- From: Morten Welinder <mortenw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnumeric] xslx: import font family name.
- Date: Fri, 23 Jan 2015 20:24:45 +0000 (UTC)
commit 9a2b2386c894bf40f8948f5547e93c2afeaca576
Author: Morten Welinder <terra gnome org>
Date: Fri Jan 23 15:24:35 2015 -0500
xslx: import font family name.
NEWS | 3 +++
plugins/excel/ChangeLog | 4 ++++
plugins/excel/xlsx-read-drawing.c | 21 ++++++++++++++++++---
3 files changed, 25 insertions(+), 3 deletions(-)
---
diff --git a/NEWS b/NEWS
index 9957864..9b282c0 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,8 @@
Gnumeric 1.12.20
+Morten:
+ * xlsx chart import: fix font family name.
+
--------------------------------------------------------------------------
Gnumeric 1.12.19
diff --git a/plugins/excel/ChangeLog b/plugins/excel/ChangeLog
index 094d96c..b4e98ce 100644
--- a/plugins/excel/ChangeLog
+++ b/plugins/excel/ChangeLog
@@ -1,3 +1,7 @@
+2015-01-23 Morten Welinder <terra gnome org>
+
+ * xlsx-read-drawing.c (xlsx_rpr_latin): Read typeface from xlsx charts.
+
2015-01-23 Morten Welinder <terra gnome org>
* Release 1.12.19
diff --git a/plugins/excel/xlsx-read-drawing.c b/plugins/excel/xlsx-read-drawing.c
index 658ef59..83dce71 100644
--- a/plugins/excel/xlsx-read-drawing.c
+++ b/plugins/excel/xlsx-read-drawing.c
@@ -239,7 +239,22 @@ xlsx_draw_text_run_props (GsfXMLIn *xin, xmlChar const **attrs)
}
}
- go_style_set_font (state->cur_style, go_font_new_by_desc (desc));
+ go_style_set_font (style, go_font_new_by_desc (desc));
+}
+
+static void
+xlsx_rpr_latin (GsfXMLIn *xin, xmlChar const **attrs)
+{
+ XLSXReadState *state = (XLSXReadState *)xin->user_state;
+ GOStyle *style = state->cur_style;
+
+ for (; attrs && *attrs; attrs += 2) {
+ if (strcmp (attrs[0], "typeface") == 0) {
+ PangoFontDescription *desc = pango_font_description_copy (style->font.font->desc);
+ pango_font_description_set_family (desc, attrs[1]);
+ go_style_set_font (style, go_font_new_by_desc (desc));
+ }
+ }
}
static void
@@ -1846,7 +1861,7 @@ GSF_XML_IN_NODE_FULL (START, CHART_SPACE, XL_NS_CHART, "chartSpace", GSF_XML_NO_
GSF_XML_IN_NODE (PR_P_PR, PR_P_PR_DEF, XL_NS_DRAW, "defRPr", GSF_XML_NO_CONTENT,
&xlsx_draw_text_run_props, NULL),
GSF_XML_IN_NODE (PR_P_PR_DEF, PR_P_PR_DEF_CS, XL_NS_DRAW, "cs", GSF_XML_NO_CONTENT, NULL, NULL),
GSF_XML_IN_NODE (PR_P_PR_DEF, PR_P_PR_DEF_EA, XL_NS_DRAW, "ea", GSF_XML_NO_CONTENT, NULL, NULL),
- GSF_XML_IN_NODE (PR_P_PR_DEF, PR_P_PR_DEF_LATIN, XL_NS_DRAW, "latin", GSF_XML_NO_CONTENT, NULL,
NULL),
+ GSF_XML_IN_NODE (PR_P_PR_DEF, PR_P_PR_DEF_LATIN, XL_NS_DRAW, "latin", GSF_XML_NO_CONTENT,
&xlsx_rpr_latin, NULL),
GSF_XML_IN_NODE (PR_P_PR_DEF, FILL_SOLID, XL_NS_DRAW, "solidFill", GSF_XML_NO_CONTENT, NULL,
NULL), /* 2nd Def */
GSF_XML_IN_NODE (PR_P_PR_DEF, PR_P_PR_DEF_UFILLTX, XL_NS_DRAW, "uFillTx", GSF_XML_NO_CONTENT,
NULL, NULL),
GSF_XML_IN_NODE (PR_P_PR_DEF, PR_P_PR_DEF_ULNTX, XL_NS_DRAW, "uLnTx", GSF_XML_NO_CONTENT, NULL,
NULL),
@@ -2651,7 +2666,7 @@ GSF_XML_IN_NODE_FULL (START, DRAWING, XL_NS_SS_DRAW, "wsDr", GSF_XML_NO_CONTENT,
GSF_XML_IN_NODE (TX_RICH_R, TX_RICH_R_PR, XL_NS_DRAW, "rPr", GSF_XML_NO_CONTENT, NULL, NULL),
GSF_XML_IN_NODE (TX_RICH_R_PR, PR_P_PR_DEF_CS, XL_NS_DRAW, "cs", GSF_XML_NO_CONTENT, NULL,
NULL),
GSF_XML_IN_NODE (TX_RICH_R_PR, PR_P_PR_DEF_EA, XL_NS_DRAW, "ea", GSF_XML_NO_CONTENT, NULL,
NULL),
- GSF_XML_IN_NODE (TX_RICH_R_PR, PR_P_PR_DEF_LATIN, XL_NS_DRAW, "latin", GSF_XML_NO_CONTENT,
NULL, NULL),
+ GSF_XML_IN_NODE (TX_RICH_R_PR, PR_P_PR_DEF_LATIN, XL_NS_DRAW, "latin", GSF_XML_NO_CONTENT,
&xlsx_rpr_latin, NULL),
GSF_XML_IN_NODE (TX_RICH_R_PR, TEXT_FILL_SOLID, XL_NS_DRAW, "solidFill", GSF_XML_NO_CONTENT,
NULL, NULL),
GSF_XML_IN_NODE (TEXT_FILL_SOLID, COLOR_RGB, XL_NS_DRAW, "srgbClr", GSF_XML_NO_CONTENT,
NULL, NULL),
GSF_XML_IN_NODE (TX_RICH_R_PR, PR_P_PR_DEF_UFILLTX, XL_NS_DRAW, "uFillTx",
GSF_XML_NO_CONTENT, NULL, NULL),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]