Skip to content
Permalink
Browse files Browse the repository at this point in the history
Match installed font filename extension to type
fixes #2598
  • Loading branch information
bsweeney committed Mar 21, 2022
1 parent 0347b9a commit 4c70e10
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/FontMetrics.php
Expand Up @@ -206,7 +206,6 @@ public function registerFont($style, $remoteFile, $context = null)
}

$cacheEntry = $localFile;
$localFile .= ".".strtolower(pathinfo(parse_url($remoteFile, PHP_URL_PATH), PATHINFO_EXTENSION));

$entry[$styleString] = $cacheEntry;

Expand Down Expand Up @@ -258,6 +257,13 @@ public function registerFont($style, $remoteFile, $context = null)
return false;
}

switch ($font->getFontType()) {
case "TrueType":
default:
$localFile .= ".ttf";
break;
}

$font->parse();
$font->saveAdobeFontMetrics("$cacheEntry.ufm");
$font->close();
Expand Down

2 comments on commit 4c70e10

@Jakess39
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Jakess39
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.