PHPOffice / PHPWord

A pure PHP library for reading and writing word processing documents
https://phpoffice.github.io/PHPWord/
Other
7.24k stars 2.69k forks source link

Support for non-standard fonts and weights? #611

Open chrisfullman opened 9 years ago

chrisfullman commented 9 years ago

In my project, I need to export a DOCX file with the body text as "Avenir" with its "Light" weight. In some cases, I know it's referred to as "Avenir Light" or "Avenir-Light." However, every variation of the font style I try ends up resulting in Arial in the final Word Doc.

Any ideas on what I'm doing wrong?

Code

$phpWord->addFontStyle('cFStyle', array(
    'name' => 'Avenir-Light'
));
[...]
$section->addText('Building a culture of engagement and philanthropy', 'cFStyle');

Results

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/26394375-support-for-non-standard-fonts-and-weights?utm_campaign=plugin&utm_content=tracker%2F323108&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F323108&utm_medium=issues&utm_source=github).
Progi1984 commented 2 months ago

@chrisfullman Hi, have you got a sample file with this font, please ?