File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
src/PhpWord/Writer/RTF/Element Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -200,6 +200,18 @@ protected function writeFontStyle()
200
200
$ styleWriter ->setColorIndex ($ colorIndex + 1 );
201
201
}
202
202
}
203
+ if ($ this ->fontStyle ->getFgColor () != null ) {
204
+ $ colorIndex = array_search ($ this ->fontStyle ->getFgColor (), $ parentWriter ->getColorTable ());
205
+ if ($ colorIndex !== false ) {
206
+ $ styleWriter ->setFgColorIndex ($ colorIndex + 1 );
207
+ }
208
+ }
209
+ if ($ this ->fontStyle ->getBgColor () != null ) {
210
+ $ colorIndex = array_search ($ this ->fontStyle ->getBgColor (), $ parentWriter ->getColorTable ());
211
+ if ($ colorIndex !== false ) {
212
+ $ styleWriter ->setBgColorIndex ($ colorIndex + 1 );
213
+ }
214
+ }
203
215
if ($ this ->fontStyle ->getName () != null ) {
204
216
$ fontIndex = array_search ($ this ->fontStyle ->getName (), $ parentWriter ->getFontTable ());
205
217
if ($ fontIndex !== false ) {
You can’t perform that action at this time.
0 commit comments