summaryrefslogtreecommitdiff
path: root/cell.go
diff options
context:
space:
mode:
Diffstat (limited to 'cell.go')
-rw-r--r--cell.go28
1 files changed, 23 insertions, 5 deletions
diff --git a/cell.go b/cell.go
index a302017..6d4c62b 100644
--- a/cell.go
+++ b/cell.go
@@ -848,7 +848,10 @@ func newRpr(fnt *Font) *xlsxRPr {
if fnt.Family != "" {
rpr.RFont = &attrValString{Val: &fnt.Family}
}
- if fnt.Size > 0.0 {
+ if inStrSlice([]string{"baseline", "superscript", "subscript"}, fnt.VertAlign, true) != -1 {
+ rpr.VertAlign = &attrValString{Val: &fnt.VertAlign}
+ }
+ if fnt.Size > 0 {
rpr.Sz = &attrValFloat{Val: &fnt.Size}
}
if fnt.Color != "" {
@@ -895,7 +898,7 @@ func newRpr(fnt *Font) *xlsxRPr {
// },
// },
// {
-// Text: " italic",
+// Text: "italic ",
// Font: &excelize.Font{
// Bold: true,
// Color: "e83723",
@@ -926,19 +929,34 @@ func newRpr(fnt *Font) *xlsxRPr {
// },
// },
// {
+// Text: " superscript",
+// Font: &excelize.Font{
+// Color: "dbc21f",
+// VertAlign: "superscript",
+// },
+// },
+// {
// Text: " and ",
// Font: &excelize.Font{
-// Size: 14,
-// Color: "ad23e8",
+// Size: 14,
+// Color: "ad23e8",
+// VertAlign: "baseline",
// },
// },
// {
-// Text: "underline.",
+// Text: "underline",
// Font: &excelize.Font{
// Color: "23e833",
// Underline: "single",
// },
// },
+// {
+// Text: " subscript.",
+// Font: &excelize.Font{
+// Color: "017505",
+// VertAlign: "subscript",
+// },
+// },
// }); err != nil {
// fmt.Println(err)
// return