Box\Spout\Writer\Style\Style::getFontName PHP Method

getFontName() public method

public getFontName ( ) : string
return string
    public function getFontName()
    {
        return $this->fontName;
    }

Usage Example

Exemplo n.º 1
0
 /**
  * Returns the contents of the "<style:text-properties>" section, inside "<style:style>" section
  *
  * @param \Box\Spout\Writer\Style\Style $style
  * @return string
  */
 private function getFontSectionContent($style)
 {
     $defaultStyle = $this->getDefaultStyle();
     $content = '<style:text-properties';
     $fontColor = $style->getFontColor();
     if ($fontColor !== $defaultStyle->getFontColor()) {
         $content .= ' fo:color="#' . $fontColor . '"';
     }
     $fontName = $style->getFontName();
     if ($fontName !== $defaultStyle->getFontName()) {
         $content .= ' style:font-name="' . $fontName . '" style:font-name-asian="' . $fontName . '" style:font-name-complex="' . $fontName . '"';
     }
     $fontSize = $style->getFontSize();
     if ($fontSize !== $defaultStyle->getFontSize()) {
         $content .= ' fo:font-size="' . $fontSize . 'pt" style:font-size-asian="' . $fontSize . 'pt" style:font-size-complex="' . $fontSize . 'pt"';
     }
     if ($style->isFontBold()) {
         $content .= ' fo:font-weight="bold" style:font-weight-asian="bold" style:font-weight-complex="bold"';
     }
     if ($style->isFontItalic()) {
         $content .= ' fo:font-style="italic" style:font-style-asian="italic" style:font-style-complex="italic"';
     }
     if ($style->isFontUnderline()) {
         $content .= ' style:text-underline-style="solid" style:text-underline-type="single"';
     }
     if ($style->isFontStrikethrough()) {
         $content .= ' style:text-line-through-style="solid"';
     }
     $content .= '/>';
     return $content;
 }
All Usage Examples Of Box\Spout\Writer\Style\Style::getFontName