Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit cc5a5d8

Browse files
authoredJul 11, 2020
use rotate in renderer
to fix meyfa#80
1 parent acc4cd9 commit cc5a5d8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed
 

‎src/Rasterization/Renderers/TextRenderer.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ protected function prepareRenderParams(SVGRasterizer $rasterizer, array $options
1313
'size' => self::prepareLengthY($options['size'], $rasterizer),
1414
'font_path' => $options['font_path'],
1515
'text' => $options['text'],
16+
'rotate' => $options['rotate']*-1,
1617
);
1718
}
1819

@@ -21,7 +22,7 @@ protected function renderFill($image, array $params, $color)
2122
imagettftext(
2223
$image,
2324
$params['size'],
24-
0,
25+
$params['rotate'],
2526
$params['x'],
2627
$params['y'],
2728
$color,
@@ -38,7 +39,7 @@ protected function renderStroke($image, array $params, $color, $strokeWidth)
3839

3940
for ($c1 = ($x-abs($px)); $c1 <= ($x+abs($px)); $c1++) {
4041
for ($c2 = ($y - abs($px)); $c2 <= ($y + abs($px)); $c2++) {
41-
imagettftext($image, $params['size'], 0, $c1, $c2, $color, $params['font_path'], $params['text']);
42+
imagettftext($image, $params['size'], $params['rotate'], $c1, $c2, $color, $params['font_path'], $params['text']);
4243
}
4344
}
4445
}

0 commit comments

Comments
 (0)
Please sign in to comment.