Skip to content
Snippets Groups Projects
Commit 3a34369e authored by Chris Hallberg's avatar Chris Hallberg
Browse files

Added grid as default mode to prevent PHP warnings in Cover Generator.

parent 2d640cd3
No related merge requests found
......@@ -64,6 +64,7 @@ class Generator
{
$this->themeTools = $themeTools;
$default = array(
'mode' => 'grid',
'authorFont' => 'DroidSerif-Bold.ttf',
'fontSize' => 7,
'lightness' => 220,
......@@ -434,7 +435,7 @@ class Generator
* @return void
*/
protected function drawText($im, $text, $x, $y,
$font, $fontSize, $mcolor, $scolor, $align = null
$font, $fontSize, $mcolor, $scolor=false, $align=null
) {
$txtWidth = $this->textWidth(
$text,
......@@ -460,10 +461,12 @@ class Generator
}
// Generate 5 lines of text, 4 offset in a border color
imagettftext($im, $fontSize, 0, $x, $y+1, $scolor, $font, $text);
imagettftext($im, $fontSize, 0, $x, $y-1, $scolor, $font, $text);
imagettftext($im, $fontSize, 0, $x+1, $y, $scolor, $font, $text);
imagettftext($im, $fontSize, 0, $x-1, $y, $scolor, $font, $text);
if ($scolor) {
imagettftext($im, $fontSize, 0, $x, $y+1, $scolor, $font, $text);
imagettftext($im, $fontSize, 0, $x, $y-1, $scolor, $font, $text);
imagettftext($im, $fontSize, 0, $x+1, $y, $scolor, $font, $text);
imagettftext($im, $fontSize, 0, $x-1, $y, $scolor, $font, $text);
}
// 1 centered in main color
imagettftext($im, $fontSize, 0, $x, $y, $mcolor, $font, $text);
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment