4

I am trying to generate .docx file from html with PhpWord package (here).

I want to use a custom Persian font (b-Nazanin) in my file. I got these formats of the font: (.ttf, .woff, .z, .cfg.z, .php).

Is there a way to add custom fonts to the PhpWord package? For example loading a TTF file and using it. The documentation only speaks about specifying an existing font, not loading a custom one.

If not, are there any other open-source packages to generate .docx file with custom fonts?

jrswgtr
  • 2,287
  • 8
  • 23
  • 49
  • Look [here](https://stackoverflow.com/questions/59611477/phpword-setting-font-inside-template-processor) and [here](https://phpword.readthedocs.io/en/latest/general.html) – Simone Rossaini Jul 20 '20 at 13:17
  • 1
    Thank you @SimoneRossaini for your response. I think the links you sent, describes how to config an existing font in PhpWord, my problem is that I don't know how to add a new custom font to PhpWord. – mohamadmamghaderi Jul 21 '20 at 11:39
  • @mohamadmamghaderi Where you able to get a way to load a custom font? – Augustus Buckman Jul 29 '21 at 13:52
  • I tried to make the question more clear, although I don't see how it was unclear to begin with. Please reopen this question! – jrswgtr Jul 26 '22 at 12:09

0 Answers0