Skip to content

fix format #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 22, 2024
Merged
Changes from all commits
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
9 changes: 4 additions & 5 deletions src/PhpWord/PhpWord.php
Original file line number Diff line number Diff line change
@@ -255,8 +255,8 @@ public function setDefaultFontName($fontName): void
{
Settings::setDefaultFontName($fontName);
}
/**

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

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


/**
* Get default font size.
*
8 changes: 4 additions & 4 deletions src/PhpWord/Settings.php
Original file line number Diff line number Diff line change
@@ -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.
*
@@ -374,8 +374,8 @@ public static function setDefaultFontName(string $value): bool

return false;
}
/**

/**
* Get default font color.
*/
public static function getDefaultFontColor(): string
6 changes: 3 additions & 3 deletions src/PhpWord/Writer/Word2007/Part/Styles.php
Original file line number Diff line number Diff line change
@@ -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();

@@ -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