Forum


Replies: 3   Views: 1938
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

Hello,

* 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 https://www.phpdocx.com/api-documentation/docxcustomizer/customize-docx-Word-documents-PHP you can read the supported styles for each content type.

Regards.