From 3d02726ad4dc3bc6a92d5b68ef8421ac4db44076 Mon Sep 17 00:00:00 2001 From: xuri Date: Fri, 14 Oct 2022 00:48:16 +0800 Subject: This closes #320, support custom chart axis font style --- shape.go | 28 +++------------------------- 1 file changed, 3 insertions(+), 25 deletions(-) (limited to 'shape.go') diff --git a/shape.go b/shape.go index eca354f..e3c6c8b 100644 --- a/shape.go +++ b/shape.go @@ -323,27 +323,6 @@ func (f *File) addDrawingShape(sheet, drawingXML, cell string, opts *shapeOption colIdx := fromCol - 1 rowIdx := fromRow - 1 - textUnderlineType := map[string]bool{ - "none": true, - "words": true, - "sng": true, - "dbl": true, - "heavy": true, - "dotted": true, - "dottedHeavy": true, - "dash": true, - "dashHeavy": true, - "dashLong": true, - "dashLongHeavy": true, - "dotDash": true, - "dotDashHeavy": true, - "dotDotDash": true, - "dotDotDashHeavy": true, - "wavy": true, - "wavyHeavy": true, - "wavyDbl": true, - } - width := int(float64(opts.Width) * opts.Format.XScale) height := int(float64(opts.Height) * opts.Format.YScale) @@ -422,10 +401,9 @@ func (f *File) addDrawingShape(sheet, drawingXML, cell string, opts *shapeOption } } for _, p := range opts.Paragraph { - u := p.Font.Underline - _, ok := textUnderlineType[u] - if !ok { - u = "none" + u := "none" + if idx := inStrSlice(supportedDrawingUnderlineTypes, p.Font.Underline, true); idx != -1 { + u = supportedDrawingUnderlineTypes[idx] } text := p.Text if text == "" { -- cgit v1.2.1