summaryrefslogtreecommitdiff
path: root/shape.go
diff options
context:
space:
mode:
authorxuri <xuri.me@gmail.com>2022-10-14 00:48:16 +0800
committerxuri <xuri.me@gmail.com>2022-10-14 00:48:16 +0800
commit3d02726ad4dc3bc6a92d5b68ef8421ac4db44076 (patch)
treeb6fe49d32bf14f7b85316073037122d24b19adf0 /shape.go
parent7363c1e3337c5f0d9c70cc8af7504b3f8c092ab4 (diff)
This closes #320, support custom chart axis font style
Diffstat (limited to 'shape.go')
-rw-r--r--shape.go28
1 files changed, 3 insertions, 25 deletions
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 == "" {