@@ -775,7 +775,7 @@ func TestSetCellStyleFont(t *testing.T) {
assert.NoError(t, f.SetCellStyle("Sheet2", "A4", "A4", style))
- style, err = f.NewStyle(`{"font":{"color":"#777777"}}`)
+ style, err = f.NewStyle(`{"font":{"color":"#777777","strike":true}}`)
if !assert.NoError(t, err) {
t.FailNow()
}
@@ -1993,6 +1993,10 @@ func (f *File) setFont(formatStyle *formatStyle) *xlsxFont {
if fnt.Name.Val == "" {
fnt.Name.Val = f.GetDefaultFont()
+ if formatStyle.Font.Strike {
+ strike := true
+ fnt.Strike = &strike
+ }
val, ok := fontUnderlineType[formatStyle.Font.Underline]
if ok {
fnt.U = &attrValString{Val: val}
@@ -320,6 +320,7 @@ type formatFont struct {
Underline string `json:"underline"`
Family string `json:"family"`
Size float64 `json:"size"`
+ Strike bool `json:"strike"`
Color string `json:"color"`