From 124328f41a9fc2f2de973b6c6ff29fc0398106e7 Mon Sep 17 00:00:00 2001 From: Dennis Verspuij <6680484+dennisverspuij@users.noreply.github.com> Date: Wed, 1 Apr 2020 21:57:40 +0200 Subject: [PATCH] Fixed custom fontDir must set through Dompdf constructor in order to retain previously loaded fonts --- load_font.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/load_font.php b/load_font.php index 866cc06..5a7a797 100755 --- a/load_font.php +++ b/load_font.php @@ -57,10 +57,11 @@ function usage() { usage(); } -$dompdf = new Dompdf(); +$options = new Options(); if (isset($fontDir) && realpath($fontDir) !== false) { - $dompdf->getOptions()->set('fontDir', $fontDir); + $options->set('fontDir', $fontDir); } +$dompdf = new Dompdf($options); /** * Installs a new font family