Replies: 3   Views: 1836
How can i change the font of a template?
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phpdocx version and check the Documentation available.

Posted by admin  · 23-03-2020 - 11:24


* wildcard doesn't apply to internal contents, so we recommend you to use your second approach but applying it only to content types that support font styles:

foreach (array('paragraph', 'run', 'list', 'style') as $type) {
        $docx->customizeWordContent(['target' => 'document', 'type' => $type, 'contains' => '',], ['font' => 'Calibri']);

On you can read the supported styles for each content type.