summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxuri <xuri.me@gmail.com>2019-06-07 09:16:55 +0800
committerxuri <xuri.me@gmail.com>2019-06-07 09:16:55 +0800
commit3997dee1f58c81444733e1756da6138d4ce445f1 (patch)
treec1aeb252ecdd741dbcb10613399af1463b71a322
parentcff16fa8118291fd885f3f3f75fa07e28bba5eec (diff)
Fix #411, change font size to float type
-rwxr-xr-x[-rw-r--r--]styles.go2
-rwxr-xr-x[-rw-r--r--]xmlChart.go2
-rwxr-xr-x[-rw-r--r--]xmlStyles.go14
3 files changed, 9 insertions, 9 deletions
diff --git a/styles.go b/styles.go
index e0e6f78..1cae186 100644..100755
--- a/styles.go
+++ b/styles.go
@@ -1981,7 +1981,7 @@ func (f *File) setFont(formatStyle *formatStyle) *xlsxFont {
fnt := xlsxFont{
B: formatStyle.Font.Bold,
I: formatStyle.Font.Italic,
- Sz: &attrValInt{Val: formatStyle.Font.Size},
+ Sz: &attrValFloat{Val: formatStyle.Font.Size},
Color: &xlsxColor{RGB: getPaletteColor(formatStyle.Font.Color)},
Name: &attrValString{Val: formatStyle.Font.Family},
Family: &attrValInt{Val: 2},
diff --git a/xmlChart.go b/xmlChart.go
index 972ead3..d23364c 100644..100755
--- a/xmlChart.go
+++ b/xmlChart.go
@@ -209,7 +209,7 @@ type aRPr struct {
SmtID uint64 `xml:"smtId,attr,omitempty"`
Spc int `xml:"spc,attr"`
Strike string `xml:"strike,attr,omitempty"`
- Sz int `xml:"sz,attr,omitempty"`
+ Sz float64 `xml:"sz,attr,omitempty"`
U string `xml:"u,attr,omitempty"`
SolidFill *aSolidFill `xml:"a:solidFill"`
Latin *aLatin `xml:"a:latin"`
diff --git a/xmlStyles.go b/xmlStyles.go
index 5c198e7..46587da 100644..100755
--- a/xmlStyles.go
+++ b/xmlStyles.go
@@ -96,7 +96,7 @@ type xlsxFont struct {
Condense bool `xml:"condense,omitempty"`
Extend bool `xml:"extend,omitempty"`
Color *xlsxColor `xml:"color"`
- Sz *attrValInt `xml:"sz"`
+ Sz *attrValFloat `xml:"sz"`
U *attrValString `xml:"u"`
Scheme *attrValString `xml:"scheme"`
}
@@ -315,12 +315,12 @@ type xlsxStyleColors struct {
// 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"`
+ Bold bool `json:"bold"`
+ Italic bool `json:"italic"`
+ Underline string `json:"underline"`
+ Family string `json:"family"`
+ Size float64 `json:"size"`
+ Color string `json:"color"`
}
// formatStyle directly maps the styles settings of the cells.