diff --git a/src/PHPWord/Writer/Word2007/Base.php b/src/PHPWord/Writer/Word2007/Base.php index 1ed5bdeefa..1898e4c555 100644 --- a/src/PHPWord/Writer/Word2007/Base.php +++ b/src/PHPWord/Writer/Word2007/Base.php @@ -303,6 +303,8 @@ protected function _writeTextStyle(PHPWord_Shared_XMLWriter $objWriter = null, P $fgColor = $style->getFgColor(); $striketrough = $style->getStrikethrough(); $underline = $style->getUnderline(); + $subscript = $style->getSubscript(); + $superscript = $style->getSuperscript(); $objWriter->startElement('w:rPr'); @@ -355,6 +357,20 @@ protected function _writeTextStyle(PHPWord_Shared_XMLWriter $objWriter = null, P $objWriter->writeElement('w:strike', null); } + // Subscript + if($subscript) { + $objWriter->startElement('w:vertAlign'); + $objWriter->writeAttribute('w:val', 'subscript'); + $objWriter->endElement(); + } + + // Superscript + if($superscript) { + $objWriter->startElement('w:vertAlign'); + $objWriter->writeAttribute('w:val', 'superscript'); + $objWriter->endElement(); + } + // Foreground-Color if(!is_null($fgColor)) { $objWriter->startElement('w:highlight');