If you have customised your IP installation or PDF templates to use that font, a possible fix could be to download the XB Riyaz TTF files from the mPDF repository
and to move them into the folder “vendor/mpdf/mpdf/ttfonts/” of your IP installation.
Hi Miquel,
thank you very much for your help, uploading the font (partially) worked!
There is still an issue though: the error doesn’t show up any more and now the preview can be seen, however it also shows a strange sign as on the screenshot below. Normally there should be anything there instead of this sign.
Maybe to solve this is there a possibility in the program to simply choose which font should invoices be showed in?
Not sure it’s visible on the screenshot, but also the invoice number show up in a different font than the rest of the invoice. It’s not a problem, but apparently for some reason than area of the program pulls a different font.
Kindest regards and thanks a lot again!
That square with a question mark means the letter or symbol that should have been drawn in that position is missing in the original font or in the substitute fonts available. Can you provide some more information:
Does it happen in the html, in the pdf or in both?
Which symbol was displayed before installing the new font?
Even better, could you copy and paste in your reply the text with the missing symbol shown in your screen capture? Make sure to put it in a separate line and that it looks the same when pasted in your reply.
Hi Miquel,
thanks a lot for your answer.
It happens after we use the option “Download PDF”, so in the browser (where the URLs have the generate_pdf part). The downloaded pdf file looks the same as in the browser.
Before there was the initial error (“mPDF Error - cannot find TTF TrueType font file”) there was just an empty space, it would simply look as “Invoice 01” in the same font. At the moment “Invoice” and “01” display in different fonts.
Copy pasting gives this:
Invoice 01
Not sure why the question mark doesn’t copy…
Kindest regards
Mystery solved with the help of this question posted in Stack Exchange.
Short answer: you have the Unicode character “ZERO WIDTH NO-BREAK SPACE” between the space after “Invoice” and the “01”. I don’t now how you got the invoice number, but somehow you have introduced that character in your invoices numbering scheme.
Long answer: the text you pasted does contain the extra character, though it is not seen because this forum software uses Unicode internally and hence properly displays the “zero width space character”. I have copied the whole string to a plain text editor, the I have saved the file, and the octal dump of the content shows the extra character “357 273 277” after the space character (040) and before the zero character (060)
$ od -cb missing-character.txt
0000000 I n v o i c e 357 273 277 0 1 \n
111 156 166 157 151 143 145 040 357 273 277 060 061 012
0000016
and this page says that “357 273 277” is the octal representation of the Unicode character “ZERO WIDTH NO-BREAK SPACE”.