Open catalystfd opened 1 year ago
I should add that the text is added via code that looks like this
$pdf->setFont('robotoslab', "", 60);
$pdf->writeHTMLCell(296.0001, 0, 1, 0, "The quick brown fox jumps over the lazy dog", 0, 0, false, true, "C");
where font would be 'robotoslab" and attr an empty string "" for the regular font.
I've been attempting to embed the RobotoSans font family from https://fonts.google.com/specimen/Roboto+Slab into a Moodle LMS distribution.
Specifically in this case just the regular size font from the static distribution.
I've converted it using the recommended process of calling addTTFfont passing the truetype unicode parameter.
run from the CLI to generate the required font files.
This font can then be selected from the UI as required
However when you generate a test pdf, although the font is supposedly embedded, it does not appear to be a correctly formatted stream
Example PDF test-14.pdf
Output of PDF fonts
If you try to open it in something like ghostscript you can see that the embedded font stream breaks
Here are the generated versions of the php and font files from the convert script robotoslab.zip
The bundled TCPDF version in moodle is v6.5.0 (2022-08-12)
and i'm generating using
PHP 7.4.32 (cli) (built: Sep 29 2022 14:27:24) ( NTS )
The normal roboto bold font was embeddable just fine, so I'm wondering what might be different about RobotoSlab here that could explain the difference.