From 3c058126ea3cf1216a3e4fcab4ab08e79f9be2e6 Mon Sep 17 00:00:00 2001 From: Anton Komarev Date: Thu, 12 Oct 2023 00:24:42 +0300 Subject: [PATCH] Code style fix --- src/Calculator/SvgFont.php | 7 +++---- src/Calculator/SvgTextSizeCalculator.php | 2 -- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/Calculator/SvgFont.php b/src/Calculator/SvgFont.php index 963113f..662bd8d 100644 --- a/src/Calculator/SvgFont.php +++ b/src/Calculator/SvgFont.php @@ -11,8 +11,6 @@ namespace PUGX\Poser\Calculator; -use XMLReader; - /** * @author Anton Komarev */ @@ -80,6 +78,7 @@ public static function fromFile( $codePoint = $codePoints[0]; $glyphs[$codePoint] = new \stdClass(); + $glyphHorizAdvX = $xml->getAttribute('horiz-adv-x'); if (empty($glyphHorizAdvX)) { @@ -90,7 +89,7 @@ public static function fromFile( $glyphs[$codePoint]->d = $xml->getAttribute('d'); - if ($codePoint === self::UNICODE_CODE_POINT_M_LOWERCASE) { + if (self::UNICODE_CODE_POINT_M_LOWERCASE === $codePoint) { $glyphSpacingHorizAdvX = $glyphs[$codePoint]->horizAdvX; } } @@ -115,7 +114,7 @@ public function computeWidth( $glyphAdvX = $this->getGlyphAdvX($codePoint); - $glyphWidth = $glyphAdvX * $size; + $glyphWidth = $glyphAdvX * $size; $glyphSpacingWidth = $this->glyphSpacingAdvX * $glyphSpacing * $size; return $glyphWidth + $glyphSpacingWidth; diff --git a/src/Calculator/SvgTextSizeCalculator.php b/src/Calculator/SvgTextSizeCalculator.php index 9e16454..da18561 100644 --- a/src/Calculator/SvgTextSizeCalculator.php +++ b/src/Calculator/SvgTextSizeCalculator.php @@ -11,8 +11,6 @@ namespace PUGX\Poser\Calculator; -use PUGX\Poser\Calculator\TextSizeCalculatorInterface; - /** * @author Anton Komarev */