Hello,
As explained in our previous reply, adding custom character styles using HTML contents (embedHTML and replaceVariableByHTML methods) was added in phpdocx 9.5. As you are using phpdocx 8.2 you need to upgrade your license to be able to use this feature.
Regards.