We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I have custom font on the DokuWiki page. And there is no options to use the same font in PDF. As I see there is hardcoded DejaVu font.
Moreover, after I edited DokuPDF class with following codes, it also didn't help:
DokuPDF
... line 50 ... $defaultConfig = (new Mpdf\Config\ConfigVariables())->getDefaults(); $fontDirs = $defaultConfig['fontDir']; $defaultFontConfig = (new Mpdf\Config\FontVariables())->getDefaults(); $fontData = $defaultFontConfig['fontdata']; // we're always UTF-8 parent::__construct( array( 'mode' => $mode, 'format' => $format, 'fontsize' => $fontsize, 'ImageProcessorClass' => DokuImageProcessorDecorator::class, 'tempDir' => _MPDF_TEMP_PATH, //$conf['tmpdir'] . '/tmp/dwpdf', 'fontDir' => array_merge($fontDirs, [ __DIR__ . '/../../tpl/dnd/fonts', ]), 'fontdata' => $fontData + [ 'Nodesto' => [ 'R' => 'Nodesto.otf' ] ], 'default_font' => 'Nodesto' ) );
Is there a way to use custom font in dw2pdf?
The text was updated successfully, but these errors were encountered:
Not sure this is the best/recommended way, but I got this to work by adding my custom font to vendor/mpdf/mpdf/src/Config/Fontvariables.php:
'fontdata' => [ "roboto" => [ 'R' => "Roboto-Light.ttf", 'B' => "Roboto-Medium.ttf", 'I' => "Roboto-Italic", 'BI' => "Roboto-BoldItalic.ttf", ],
and then setting roboto as font-family in my style.css.
Sorry, something went wrong.
Perfect!
I would expect, that an approach like the startpost should be possible. Maybe some details needs attention there?
Proposals to add other fonts to the configuration of mpdf are welcome. Please let continue the discussion in similar issue #445.
No branches or pull requests
I have custom font on the DokuWiki page. And there is no options to use the same font in PDF. As I see there is hardcoded DejaVu font.
Moreover, after I edited
DokuPDF
class with following codes, it also didn't help:Is there a way to use custom font in dw2pdf?
The text was updated successfully, but these errors were encountered: