From 198ccf922a3ba0a3d9e022bc1c0ec0b3cfe1d369 Mon Sep 17 00:00:00 2001 From: danielscsc <131862112+danielscsc@users.noreply.github.com> Date: Thu, 11 Jan 2024 00:11:48 +0200 Subject: [PATCH] Fix path to maps in AdobeFontMetrics.php `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__) . '/../'` --- src/FontLib/AdobeFontMetrics.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/FontLib/AdobeFontMetrics.php b/src/FontLib/AdobeFontMetrics.php index 1440c3e..e902e3e 100644 --- a/src/FontLib/AdobeFontMetrics.php +++ b/src/FontLib/AdobeFontMetrics.php @@ -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)"); }