dokuwiki-plugin-dw2pdf icon indicating copy to clipboard operation
dokuwiki-plugin-dw2pdf copied to clipboard

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

Open nd1976 opened this issue 4 years ago • 5 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.

nd1976 avatar Nov 15 '21 14:11 nd1976

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.

Klap-in avatar Oct 08 '22 21:10 Klap-in

Similar as #402

Klap-in avatar Oct 12 '22 19:10 Klap-in

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 avatar Oct 12 '22 20:10 Klap-in

@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

mstumberger avatar Feb 18 '24 09:02 mstumberger

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

Klap-in avatar Feb 18 '24 21:02 Klap-in