24 switch ($horizontalAlignment) {
41 switch ($verticalAlignment) {
58 $this->writer->writeAttribute(
'fo:background-color', sprintf(
76 $hAlign = $style->getAlignment()->getHorizontal();
77 $vAlign = $style->getAlignment()->getVertical();
78 $wrap = $style->getAlignment()->getWrapText();
80 $this->writer->startElement(
'style:table-cell-properties');
81 if (!empty($vAlign) || $wrap) {
82 if (!empty($vAlign)) {
84 $this->writer->writeAttribute(
'style:vertical-align', $vAlign);
87 $this->writer->writeAttribute(
'fo:wrap-option',
'wrap');
90 $this->writer->writeAttribute(
'style:rotation-align',
'none');
93 if ($fill = $style->getFill()) {
97 $this->writer->endElement();
99 if (!empty($hAlign)) {
101 $this->writer->startElement(
'style:paragraph-properties');
102 $this->writer->writeAttribute(
'fo:text-align', $hAlign);
103 $this->writer->endElement();
124 $this->writer->startElement(
'style:text-properties');
126 $font = $style->getFont();
128 if ($font->getBold()) {
129 $this->writer->writeAttribute(
'fo:font-weight',
'bold');
130 $this->writer->writeAttribute(
'style:font-weight-complex',
'bold');
131 $this->writer->writeAttribute(
'style:font-weight-asian',
'bold');
134 if ($font->getItalic()) {
135 $this->writer->writeAttribute(
'fo:font-style',
'italic');
138 if ($color = $font->getColor()) {
139 $this->writer->writeAttribute(
'fo:color', sprintf(
'#%s', $color->getRGB()));
142 if ($family = $font->getName()) {
143 $this->writer->writeAttribute(
'fo:font-family', $family);
146 if (
$size = $font->getSize()) {
147 $this->writer->writeAttribute(
'fo:font-size', sprintf(
'%.1Fpt',
$size));
151 $this->writer->writeAttribute(
'style:text-underline-style',
'solid');
152 $this->writer->writeAttribute(
'style:text-underline-width',
'auto');
153 $this->writer->writeAttribute(
'style:text-underline-color',
'font-color');
156 $this->writer->writeAttribute(
'style:text-underline-type', $underline);
159 $this->writer->endElement();
164 $this->writer->startElement(
'style:style');
165 $this->writer->writeAttribute(
'style:name', self::CELL_STYLE_PREFIX . $style->getIndex());
166 $this->writer->writeAttribute(
'style:family',
'table-cell');
167 $this->writer->writeAttribute(
'style:parent-style-name',
'Default');
176 $this->writer->endElement();
mapUnderlineStyle(Font $font)
const FILL_GRADIENT_LINEAR
writeTextProperties(CellStyle $style)
__construct(XMLWriter $writer)
getStartColor()
Get Start Color.
mapVerticalAlignment(string $verticalAlignment)
getUnderline()
Get Underline.
const HORIZONTAL_CENTER_CONTINUOUS
writeCellProperties(CellStyle $style)
getFillType()
Get Fill Type.
mapHorizontalAlignment(string $horizontalAlignment)
const UNDERLINE_SINGLEACCOUNTING
writeFillStyle(Fill $fill)
const VERTICAL_DISTRIBUTED
const UNDERLINE_DOUBLEACCOUNTING
const HORIZONTAL_DISTRIBUTED