Skip to content

Commit

Permalink
Fix path to maps in AdobeFontMetrics.php
Browse files Browse the repository at this point in the history
`dirname(__FILE__)` gives you `php-font-lib/src/Fontlib`
`dirname(__FILE__) . '/../'` gives you `php-font-lib/src/`

We need one more level up, to hit /maps.

P.S.  We can also use `__DIR__ . '/../../'` OR `dirname(__DIR__) . '/../'`
  • Loading branch information
danielscsc authored and bsweeney committed Jan 20, 2024
1 parent 671df0f commit 34c5dc9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/FontLib/AdobeFontMetrics.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function write($file, $encoding = null) {

if ($encoding) {
$encoding = preg_replace("/[^a-z0-9-_]/", "", $encoding);
$map_file = dirname(__FILE__) . "/../maps/$encoding.map";
$map_file = dirname(__FILE__) . "/../../maps/$encoding.map";
if (!file_exists($map_file)) {
throw new \Exception("Unknown encoding ($encoding)");
}
Expand Down

0 comments on commit 34c5dc9

Please sign in to comment.