Skip to content

Commit

Permalink
Merge pull request #1 from MichaelPFrey/fix-mfr-2024-11-22
Browse files Browse the repository at this point in the history
fix format
  • Loading branch information
Collie-IT authored Nov 22, 2024
2 parents 5031311 + 61c3375 commit a781d7d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 12 deletions.
9 changes: 4 additions & 5 deletions src/PhpWord/PhpWord.php
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,8 @@ public function setDefaultFontName($fontName): void
{
Settings::setDefaultFontName($fontName);
}
/**

/**
* Set default font color.
*
* @param string $fontColor
Expand All @@ -265,8 +265,8 @@ public function setDefaultFontColor($fontColor): void
{
Settings::setDefaultFontColor($fontColor);
}
/**

/**
* Get default font color.
*
* @return string
Expand All @@ -276,7 +276,6 @@ public function getDefaultFontColor()
return Settings::getDefaultFontColor();
}


/**
* Get default font size.
*
Expand Down
8 changes: 4 additions & 4 deletions src/PhpWord/Settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,13 @@ class Settings
*/
private static $defaultFontName = self::DEFAULT_FONT_NAME;

/**
/**
* Default font color.
*
* @var string
*/
private static $defaultFontColor = self::DEFAULT_FONT_COLOR;

/**
* Default font size.
*
Expand Down Expand Up @@ -374,8 +374,8 @@ public static function setDefaultFontName(string $value): bool

return false;
}
/**

/**
* Get default font color.
*/
public static function getDefaultFontColor(): string
Expand Down
6 changes: 3 additions & 3 deletions src/PhpWord/Writer/Word2007/Part/Styles.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ private function writeDefaultStyles(XMLWriter $xmlWriter, $styles): void
$phpWord = $this->getParentWriter()->getPhpWord();
$fontName = $phpWord->getDefaultFontName();
$fontSize = $phpWord->getDefaultFontSize();
$fontColor = $phpWord->getDefaultFontColor();
$fontColor = $phpWord->getDefaultFontColor();
$language = $phpWord->getSettings()->getThemeFontLang();
$latinLanguage = ($language == null || $language->getLatin() === null) ? 'en-US' : $language->getLatin();

Expand All @@ -98,9 +98,9 @@ private function writeDefaultStyles(XMLWriter $xmlWriter, $styles): void
$xmlWriter->writeAttribute('w:eastAsia', $fontName);
$xmlWriter->writeAttribute('w:cs', $fontName);
$xmlWriter->endElement(); // w:rFonts
$xmlWriter->startElement('w:color');
$xmlWriter->startElement('w:color');
$xmlWriter->writeAttribute('w:val', $fontColor);
$xmlWriter->endElement();
$xmlWriter->endElement();
$xmlWriter->startElement('w:sz');
$xmlWriter->writeAttribute('w:val', $fontSize * 2);
$xmlWriter->endElement(); // w:sz
Expand Down

0 comments on commit a781d7d

Please sign in to comment.