Skip to content

Commit

Permalink
Allow legacy installed font info distribution file
Browse files Browse the repository at this point in the history
Because Dompdf allows some customization of its operational parameters a user may load a custom dompdf_font_family_cache.dist.php. If a user has created and is loading such a file, and is using a pre-1.1.0 format, Dompdf will fail to run. This change allows Dompdf to utilize the file regardless of which format it is in.

fixes #2648
  • Loading branch information
bsweeney committed Nov 23, 2021
1 parent da6a2f4 commit e3fbe34
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/FontMetrics.php
Expand Up @@ -133,8 +133,7 @@ public function loadFontFamilies()

$file = $rootDir . "/lib/fonts/dompdf_font_family_cache.dist.php";
$distFontsClosure = require $file;
$distFonts = $distFontsClosure($rootDir);

$distFonts = is_array($distFontsClosure) ? $distFontsClosure : $distFontsClosure($rootDir);
if (!is_readable($this->getCacheFile())) {
$this->fontLookup = $distFonts;
return;
Expand Down

0 comments on commit e3fbe34

Please sign in to comment.