splitbrain / dokuwiki-plugin-dw2pdf

A fork of Luigi Micco's PDF export plugin for DokuWiki

Home Page:http://www.dokuwiki.org/plugin:dw2pdf

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support adding custom fonts to DW2PDF including the extra configuration needed for mpdf library

nd1976 opened this issue · comments

How Can I change the font family to use the CI one and not the created "DejaVu Sans Condensed"

I tried it with a template in the tpl folder and I wrote in the Fontface in the CSS file. But it does not change anything.

Extra fonts should be also configured in the mpdf library, this should be done in the DokuPDF.class.php or action.php.
See https://mpdf.github.io/fonts-languages/fonts-in-mpdf-7-x.html

Proposals welcome as pull request.

Similar as #402

Example for the fontawesome font: https://stackoverflow.com/a/58702825/1043588

I'm wondering what is practical manner to implement. Add a default font folder for extra fonts to the dw2pdf folder, and let in the config add the names of the fonts to configure? Probably just looping over the names is not nuanced enough.
Define a e.g. font.php file in the pdf-template folder that add the right fonts? With enough examples in the manual?

@Klap-in thanks for the tip, I'we tried this but got an arror saying that font is not supported...
I used this font:
https://www.cdnpkg.com/line-awesome/file/fa-solid-900.ttf/
image

image

I have no time to help you debugging, sorry. Further no suggestions yet.