Hello,
HTML to DOCX methods set a default font size and font family to handle all CSS styles and properties. Until the launch of phpdocx 10, when you replaced a placeholder using replaceVariableByHTML, the new contents applied font size and font family styles from the HTML/CSS (default styles when not set) overwriting the placeholder styles; so to apply the exact placeholder styles they needed to be added manually to the HTML/CSS or caught dynamically using getWordStyles.
Since the release of phpdocx 10, Premium licenses include the stylesReplacementType option in replaceVariableByHTML. This option allows mixing and replacing HTML/CSS and placeholder styles when doing replacements. We recommend you to read the information available about this option on https://www.phpdocx.com/api-documentation/templates/replace-variable-html-Word-document, and also checks the included samples in the package, that illustrates how to use this option.
Regards.