PDF font problem

try the described method of loading your font into the library
Fabrik domPDf is not the latest version.


ah, and which exact Fabrik version are you running?
There was an issue with loading css files.
gesendet mit Tapatalk
 
Last edited:
I use Fabrik 3.5 - but will try to update from github. The load_font.php method is not easy on a webserver - I have no command line access ??
 
Updated from Github, but the include method still only shows the right font in debug mode not in the pdf ??? Any suggestions ?
 
I have been looking a little around in the pdf folder of fabrik and the dompdf library. I cannot find any reference to the file dompdf/inlucde/font_metrics.cls.php - which i suppose should load the newly added font - is this a bug. How are the fonts, added with load_font.php (I managed to use load_font on my raspberry), suposed to be included then ?
 
I'm not on my PC. But in domPDF there's a folder with all the fonts. Include your font there and set the CSS. There's an example in the WIKI, maybe you have to use ! important

gesendet mit Tapatalk
 
Sorry - but it does NOT work. I have done this:
Used load_font.php and now I have theese two files in /libraries/dompdf/fonts/

bodoni-mpc.ttf
bodoni-mpc.ufm

In dompdf_font_family_cache.dist.php - this was added:

'bodoni' =>
array (
'normal' => DOMPDF_FONT_DIR . 'bodoni-mpc',
'bold' => DOMPDF_FONT_DIR . 'bodoni-mpc',
'italic' => DOMPDF_FONT_DIR . 'bodoni-mpc',
'bold_italic' => DOMPDF_FONT_DIR . 'bodoni-mpc',
),

In my pdf view in default.php I have this header line:

<p class="header" style="text-align:center;line-height:55px !Important;font-size:48px;font-family:bodoni !Important;"><?php echo $modelarray->element_ro; ?></p>

This does nothing, not in debug mode nor in the pdf rendering!

BUT....

If I add this to custom_css.php in my view and place the font in the specified folder:

@font-face {
font-family: 'bodoni';
font-style: normal;
font-weight: normal;
src: url(http://xxxxxx.dk/font/bodoni-mpc.ttf) format('truetype');
}

the correct font is shown in debug mode:
correct%20font%20in%20debug%20mode.png

but not in the rendered pdf:
wrong%20font%20in%20rendered%20pdf.png
 
debug mode is not going through domPDF but just showing what will be sent to.
So in case of fonts and float etc it doesn't help much.

gesendet mit Tapatalk
 
Well then I am simply lost, have not got a clue how to make this work when the information provided in the wiki not is working?
 
After updateing to J! 3.8.1 and the latest branch of fabrik (5 days ago) the custom font is no longer included in the pdf ?? Has the dompdf directory changed ??
 
You could update the wiki, if you like.

We didn't have a choice about the change of folder location, as DOMPDF implemented Composer deployment and autoloading in version 0.8.

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top