diff --git a/src/Calculator/Font/HelveticaNeue.svg b/src/Calculator/Font/HelveticaNeue.svg
new file mode 100644
index 0000000..134a1d3
--- /dev/null
+++ b/src/Calculator/Font/HelveticaNeue.svg
@@ -0,0 +1,597 @@
+
+
+
diff --git a/src/Calculator/Font/HelveticaNeueBold.svg b/src/Calculator/Font/HelveticaNeueBold.svg
new file mode 100644
index 0000000..b46e26b
--- /dev/null
+++ b/src/Calculator/Font/HelveticaNeueBold.svg
@@ -0,0 +1,563 @@
+
+
+
diff --git a/src/Render/SvgSocialRender.php b/src/Render/SvgSocialRender.php
new file mode 100644
index 0000000..c7c8f1e
--- /dev/null
+++ b/src/Render/SvgSocialRender.php
@@ -0,0 +1,76 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace PUGX\Poser\Render;
+
+use PUGX\Poser\Badge;
+use PUGX\Poser\Calculator\TextSizeCalculatorInterface;
+
+class SvgSocialRender extends LocalSvgRenderer
+{
+ public const VENDOR_TEXT_FONT = __DIR__ . '/../Calculator/Font/HelveticaNeue.svg';
+ public const VALUE_TEXT_FONT = __DIR__ . '/../Calculator/Font/HelveticaNeueBold.svg';
+ public const TEXT_FONT_SIZE = 10;
+ public const TEXT_FONT_COLOR = '#FFFFFF';
+ public const TEXT_LETTER_SPACING = 0.1;
+ public const PADDING_X = 8;
+ public const ARROW_WIDTH = 6.5;
+
+ private \EasySVG $easy;
+
+ public function __construct(
+ ?\EasySVG $easySVG = null,
+ ?TextSizeCalculatorInterface $textSizeCalculator = null,
+ ?string $templatesDirectory = null
+ ) {
+ parent::__construct($textSizeCalculator, $templatesDirectory);
+
+ if (null === $easySVG) {
+ $easySVG = new \EasySVG();
+ }
+
+ $this->easy = $easySVG;
+ }
+
+ public function getBadgeStyle(): string
+ {
+ return 'social';
+ }
+
+ protected function getTemplateName(): string
+ {
+ return $this->getBadgeStyle();
+ }
+
+ protected function buildParameters(Badge $badge): array
+ {
+ $parameters = parent::buildParameters($badge);
+
+ $this->easy->clearSVG();
+ $this->easy->setLetterSpacing(self::TEXT_LETTER_SPACING);
+ $this->easy->setFont(self::VENDOR_TEXT_FONT, self::TEXT_FONT_SIZE, self::TEXT_FONT_COLOR);
+ $vendorDimensions = $this->easy->textDimensions($parameters['vendor']);
+ $parameters['vendorWidth'] = $vendorDimensions[0] + 2 * self::PADDING_X;
+ $parameters['vendorStartPosition'] = \round($parameters['vendorWidth'] / 2);
+
+ $this->easy->clearSVG();
+ $this->easy->setLetterSpacing(self::TEXT_LETTER_SPACING);
+ $this->easy->setFont(self::VALUE_TEXT_FONT, self::TEXT_FONT_SIZE, self::TEXT_FONT_COLOR);
+ $valueDimensions = $this->easy->textDimensions($parameters['value']);
+ $parameters['valueWidth'] = $valueDimensions[0] + 2 * self::PADDING_X;
+ $parameters['valueStartPosition'] = $parameters['vendorStartPosition'] + \round(self::ARROW_WIDTH) + \round($parameters['valueWidth'] / 2);
+
+ $parameters['vendorAndArrowWidth'] = $parameters['vendorWidth'] + self::ARROW_WIDTH;
+ $parameters['totalWidth'] = $parameters['vendorAndArrowWidth'] + $parameters['valueWidth'];
+
+ return $parameters;
+ }
+}
diff --git a/src/Resources/templates/social.svg b/src/Resources/templates/social.svg
new file mode 100644
index 0000000..ab13119
--- /dev/null
+++ b/src/Resources/templates/social.svg
@@ -0,0 +1,27 @@
+
diff --git a/src/UI/Command.php b/src/UI/Command.php
index 568dc99..811ea95 100644
--- a/src/UI/Command.php
+++ b/src/UI/Command.php
@@ -8,6 +8,7 @@
use PUGX\Poser\Render\SvgFlatSquareRender;
use PUGX\Poser\Render\SvgForTheBadgeRenderer;
use PUGX\Poser\Render\SvgPlasticRender;
+use PUGX\Poser\Render\SvgSocialRender;
use PUGX\Poser\ValueObject\InputRequest;
use Symfony\Component\Console\Command\Command as BaseCommand;
use Symfony\Component\Console\Input\InputArgument;
@@ -38,6 +39,7 @@ public function __construct(string $name = null)
new SvgFlatRender(),
new SvgFlatSquareRender(),
new SvgForTheBadgeRenderer(),
+ new SvgSocialRender(),
]);
$this->header = self::HEADER;
}
@@ -49,6 +51,7 @@ private function init(): void
new SvgFlatRender(),
new SvgFlatSquareRender(),
new SvgForTheBadgeRenderer(),
+ new SvgSocialRender(),
]);
$this->header = self::HEADER;
}
@@ -155,7 +158,7 @@ protected function storeImage(OutputInterface $output, string $path, string $ima
}
@\fclose($fp);
- $output->write(\sprintf('Image created at %s', $path));
+ $output->write(\sprintf('Image created at %s', $path) . \PHP_EOL);
}
protected function printHeaderOnce(OutputInterface $output): void