summaryrefslogtreecommitdiff
path: root/styles.go
diff options
context:
space:
mode:
Diffstat (limited to 'styles.go')
-rw-r--r--styles.go9
1 files changed, 3 insertions, 6 deletions
diff --git a/styles.go b/styles.go
index d6d267d..fc8a290 100644
--- a/styles.go
+++ b/styles.go
@@ -1895,11 +1895,8 @@ func (f *File) NewStyle(style string) (int, error) {
numFmtID := setNumFmt(s, fs)
if fs.Font != nil {
- font, _ := xml.Marshal(setFont(fs))
s.Fonts.Count++
- s.Fonts.Font = append(s.Fonts.Font, &xlsxFont{
- Font: string(font[6 : len(font)-7]),
- })
+ s.Fonts.Font = append(s.Fonts.Font, setFont(fs))
fontID = s.Fonts.Count - 1
}
@@ -1950,7 +1947,7 @@ func (f *File) NewConditionalStyle(style string) (int, error) {
// setFont provides a function to add font style by given cell format
// settings.
-func setFont(formatStyle *formatStyle) *font {
+func setFont(formatStyle *formatStyle) *xlsxFont {
fontUnderlineType := map[string]string{"single": "single", "double": "double"}
if formatStyle.Font.Size < 1 {
formatStyle.Font.Size = 11
@@ -1958,7 +1955,7 @@ func setFont(formatStyle *formatStyle) *font {
if formatStyle.Font.Color == "" {
formatStyle.Font.Color = "#000000"
}
- f := font{
+ f := xlsxFont{
B: formatStyle.Font.Bold,
I: formatStyle.Font.Italic,
Sz: &attrValInt{Val: formatStyle.Font.Size},