diff options
author | jialei <31276367+MichealJl@users.noreply.github.com> | 2022-06-13 23:38:59 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-13 23:38:59 +0800 |
commit | d490a0f86f02f7f2eeabd8a0f38cbaa82a669187 (patch) | |
tree | 58dbcd42c8c33faa60bae10e606ab251dc8319c3 /cell_test.go | |
parent | d383f0ae6e253284520d10e574a01b0b904c91d9 (diff) |
RichTextRun support set superscript and subscript by vertAlign attribute (#1252)
check vertical align enumeration, update set rich text docs and test
Diffstat (limited to 'cell_test.go')
-rw-r--r-- | cell_test.go | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/cell_test.go b/cell_test.go index da251cd..fb1e8ef 100644 --- a/cell_test.go +++ b/cell_test.go @@ -590,7 +590,7 @@ func TestSetCellRichText(t *testing.T) { }, }, { - Text: "text with color and font-family,", + Text: "text with color and font-family, ", Font: &Font{ Bold: true, Color: "2354e8", @@ -612,19 +612,34 @@ func TestSetCellRichText(t *testing.T) { }, }, { + Text: " superscript", + Font: &Font{ + Color: "dbc21f", + VertAlign: "superscript", + }, + }, + { Text: " and ", Font: &Font{ - Size: 14, - Color: "ad23e8", + Size: 14, + Color: "ad23e8", + VertAlign: "BASELINE", }, }, { - Text: "underline.", + Text: "underline", Font: &Font{ Color: "23e833", Underline: "single", }, }, + { + Text: " subscript.", + Font: &Font{ + Color: "017505", + VertAlign: "subscript", + }, + }, } assert.NoError(t, f.SetCellRichText("Sheet1", "A1", richTextRun)) assert.NoError(t, f.SetCellRichText("Sheet1", "A2", richTextRun)) |