From c8fe6ec1c81ccbcfba8461997b8881c0bc2dac9c Mon Sep 17 00:00:00 2001 From: Oleshko Date: Tue, 20 Jun 2023 22:25:27 +0300 Subject: [PATCH] add fontscript to html #289 --- QXlsx/source/xlsxrichstring.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/QXlsx/source/xlsxrichstring.cpp b/QXlsx/source/xlsxrichstring.cpp index 0bf3f12c..c5ff5e54 100644 --- a/QXlsx/source/xlsxrichstring.cpp +++ b/QXlsx/source/xlsxrichstring.cpp @@ -162,6 +162,12 @@ void RichString::setHtml(const QString &text) Format fmt; fmt.setFont(textFragment.charFormat().font()); fmt.setFontColor(textFragment.charFormat().foreground().color()); + if( textFragment.charFormat().verticalAlignment() == QTextCharFormat::AlignSuperScript ) { + fmt.setFontScript( Format::FontScriptSuper); + } + if( textFragment.charFormat().verticalAlignment() == QTextCharFormat::AlignSubScript ) { + fmt.setFontScript( Format::FontScriptSub); + } addFragment(textFragment.text(), fmt); } }