Skip to content

Commit c12ed05

Browse files
authored
Update Font.php - Fix Extra Space
Now that Font isn't returning unnecessary values, it could sometimes occur where it returned an extra space in the document if ($content == ''). This is fixed.
1 parent 5f97167 commit c12ed05

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/PhpWord/Writer/RTF/Style/Font.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,10 @@ public function write()
117117
// Other (Font settings currently not in included in array)
118118
$content .= $this->getValueIf($style->isNoProof(), '\noproof');
119119
$content .= $this->getValueIf($style->getBgColor() !== null, '\cb' . $this->bgColorIndex);
120+
121+
if (empty($content)) {
122+
return $content;
123+
}
120124

121125
return $content . ' ';
122126
}

0 commit comments

Comments
 (0)