I'm using PHPWord (https://github.com/PHPOffice/PHPWord/tree/develop) to generate a Word document with some text needing a background color.
PHPWord has the ability to apply inline styles to text added to a section. I am doing that via the following:
$section->addText(
"Some text",
[
"name" => "Tahoma",
"size" => 12,
"bgColor" => "#FF0000"
]);
The problem is that when I open up the resulting document in Microsoft Word I note that the colored background text is not colored in a way that is recognized as "Text Highlight Color" that you would get from using the tool in Word.
Thus, even if I select (i.e. highlight) some of the text and choose the "Text Highlight Color" tool and select "None" it doesn't remove the background color formatting that PHPWord has applied. The same goes for a text foreground color too.
My question is this: Is there a way in PHPWord to apply a background color style—and a text font color—that is recognized by the Microsoft Word application as a true "Text Highlight Color" and a true "Font Color" as would be applied in the application using that tool? Or are we limited to the inline styling that PHPWord provides?