I'm trying to add a font via Command line.
Every time I try i get the following error.
Fatal error: Class 'Font' not found in
/home/scripts/public_html/MarketingPalv2/load_font.php on line 139
I also get a similar error when I try to use @font-face
Fatal error: Class 'Font' not found in
/home/scripts/public_html/MarketingPalv2/include/font_metrics.cls.php on line 346
Hope you guys can help.
I'm late to the party here, but working with
dompdf
in 2018 still seems to experience this issue when loading Google Fonts with CSS. The specific error I see is:With version 0.8.2 (July 2018) I solved by loading the
php-font-lib
library before loadingdompdf
using the following:You'll need to make sure your composer path is correct here, I've removed a variable from the
require_once()
calls.I used dompdf-master V.0.6.1, I solved it by
require_once "../lib/php-font-lib/classes/Autoloader.php"; use FontLib\Font;
tofont_metrics.cls.php
when I install new font