From 70f6328150aa954cd9721e90883f001ea005c1ee Mon Sep 17 00:00:00 2001 From: Ri Xu Date: Tue, 16 May 2017 20:42:01 +0800 Subject: Support set font style of shape text. Relate issue #38. --- xmlStyles.go | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'xmlStyles.go') diff --git a/xmlStyles.go b/xmlStyles.go index aa0c9c8..4e7a7d1 100644 --- a/xmlStyles.go +++ b/xmlStyles.go @@ -282,6 +282,16 @@ type xlsxStyleColors struct { Color string `xml:",innerxml"` } +// formatFont directly maps the styles settings of the fonts. +type formatFont struct { + Bold bool `json:"bold"` + Italic bool `json:"italic"` + Underline string `json:"underline"` + Family string `json:"family"` + Size int `json:"size"` + Color string `json:"color"` +} + // formatCellStyle directly maps the styles settings of the borders. type formatCellStyle struct { Border []struct { @@ -295,14 +305,7 @@ type formatCellStyle struct { Color []string `json:"color"` Shading int `json:"shading"` } `json:"fill"` - Font *struct { - Bold bool `json:"bold"` - Italic bool `json:"italic"` - Underline string `json:"underline"` - Family string `json:"family"` - Size int `json:"size"` - Color string `json:"color"` - } `json:"font"` + Font *formatFont `json:"font"` Alignment *struct { Horizontal string `json:"horizontal"` Indent int `json:"indent"` -- cgit v1.2.1