Skip to content

Commit 3438934

Browse files
committed
2 parents 0eca64e + 2e6d772 commit 3438934

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Image.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -974,8 +974,9 @@ private function imagettftextWithSpacing($image, float $size, float $angle, floa
974974
$bottom = 0;
975975

976976
for ($i = 0; $i < $length; ++$i) {
977-
\imagettftext($image, $size, $angle, $letterPos['x'], $letterPos['y'], $color, $font, $text[$i]);
978-
$bbox = \imagettfbbox($size, 0, $font, $text[$i]);
977+
$char = \mb_substr($text, $i, 1);
978+
\imagettftext($image, $size, $angle, $letterPos['x'], $letterPos['y'], $color, $font, $char);
979+
$bbox = \imagettfbbox($size, 0, $font, $char);
979980
$letterPos = Geometry2D::getDstXY($letterPos['x'], $letterPos['y'], $angle, $spacing + $bbox[2]);
980981

981982
$textWidth += $bbox[2];

0 commit comments

Comments
 (0)