Skip to content
This repository has been archived by the owner on Jan 2, 2019. It is now read-only.

OpenDocument writer: basic text styling #785

Open
wants to merge 4 commits into
base: 1.8
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
PHPExcel_Writer_OpenDocument_Content: suppport italic, single underline
  • Loading branch information
agopaul committed Jan 9, 2016

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 30b078986f658f297bf8d6cb9c39838c007e52bc
10 changes: 10 additions & 0 deletions Classes/PHPExcel/Writer/OpenDocument/Content.php
Original file line number Diff line number Diff line change
@@ -315,6 +315,10 @@ private function writeXfStyles(PHPExcel_Shared_XMLWriter $objWriter, PHPExcel $p
$objWriter->writeAttribute('style:font-weight-asian', 'bold');
}

if($font->getItalic()) {
$objWriter->writeAttribute('fo:font-style', 'italic');
}

if($color = $font->getColor()) {
$objWriter->writeAttribute('fo:color', sprintf('#%s', $color->getRGB()));
}
@@ -323,6 +327,12 @@ private function writeXfStyles(PHPExcel_Shared_XMLWriter $objWriter, PHPExcel $p
$objWriter->writeAttribute('fo:font-size', sprintf('%.1fpt', $size));
}

if($font->getUnderline() == \PHPExcel_Style_Font::UNDERLINE_SINGLE) {
$objWriter->writeAttribute('style:text-underline-style', 'solid');
$objWriter->writeAttribute('style:text-underline-width', 'auto');
$objWriter->writeAttribute('style:text-underline-color', 'font-color');
}

$objWriter->endElement(); // Close style:text-properties

/*