getStyle(); if (!$style instanceof FontStyle) { return ''; } $css = array(); $font = $style->getName(); $size = $style->getSize(); $color = $style->getColor(); $fgColor = $style->getFgColor(); $underline = $style->getUnderline() != FontStyle::UNDERLINE_NONE; $lineThrough = $style->isStrikethrough() || $style->isDoubleStrikethrough(); $css['font-family'] = $this->getValueIf($font !== null, "'{$font}'"); $css['font-size'] = $this->getValueIf($size !== null, "{$size}pt"); $css['color'] = $this->getValueIf($color != Settings::DEFAULT_FONT_COLOR, "#{$color}"); $css['background'] = $this->getValueIf($fgColor != '', $fgColor); $css['font-weight'] = $this->getValueIf($style->isBold(), 'bold'); $css['font-style'] = $this->getValueIf($style->isItalic(), 'italic'); $css['vertical-align'] = $this->getValueIf($style->isSuperScript(), 'italic'); $css['vertical-align'] = $this->getValueIf($style->isSuperScript(), 'super'); $css['vertical-align'] = $this->getValueIf($style->isSubScript(), 'sub'); $css['text-decoration'] = ''; $css['text-decoration'] .= $this->getValueIf($underline, 'underline '); $css['text-decoration'] .= $this->getValueIf($lineThrough, 'line-through '); return $this->assembleCss($css); } }