Skip to content

Commit

Permalink
Merge pull request #36 from jonnitto/master
Browse files Browse the repository at this point in the history
BUGFIX: Dummy image for Neos 7.1
  • Loading branch information
mficzel committed May 23, 2021
2 parents 2215342 + d4900f9 commit b74ba41
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions Classes/Controller/DummyImageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -255,13 +255,8 @@ protected function renderBorder(ImageInterface $image, ColorInterface $foregroun
protected function renderText(ImageInterface $image, ColorInterface $textColor, int $width, int $height, string $text, bool $center = false): void
{
$initialFontSize = 10;
if (file_exists('resource://Neos.Neos/Public/Fonts/NotoSans/NotoSans-Regular.ttf')) {
$fontFile = $this->packageManager->getPackage('Neos.Neos')->getPackagePath() . "Resources/Public/Fonts/NotoSans/NotoSans-Regular.ttf";
$initialFont = $this->imagineService->font($fontFile, $initialFontSize, $textColor);
} elseif (file_exists('resource://Neos.Neos/Public/Fonts/NotoSans-Regular.ttf')) {
$fontFile = $this->packageManager->getPackage('Neos.Neos')->getPackagePath() . "Resources/Public/Fonts/NotoSans-Regular.ttf";
$initialFont = $this->imagineService->font($fontFile, $initialFontSize, $textColor);
}
$fontFile = $this->packageManager->getPackage('Sitegeist.Kaleidoscope')->getPackagePath() . "Resources/Private/Font/NotoSans-Regular.ttf";
$initialFont = $this->imagineService->font($fontFile, $initialFontSize, $textColor);

// scale text to fit the image
$initialFontBox = $initialFont->box($text);
Expand Down
Binary file added Resources/Private/Font/NotoSans-Regular.ttf
Binary file not shown.

0 comments on commit b74ba41

Please sign in to comment.