From b95ebbf0bfb7c9f7724609c13118d48d4a4a4dbe Mon Sep 17 00:00:00 2001 From: Cyril Pereira Date: Tue, 1 Nov 2016 22:46:29 +0100 Subject: [PATCH 1/3] Added rounded stroke Here is a fixe to have rounded stroke, it's really more sexy and cute --- src/Box.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/Box.php b/src/Box.php index 3bb35bc..170d2b0 100644 --- a/src/Box.php +++ b/src/Box.php @@ -323,7 +323,8 @@ public function draw($text) } - $this->strokeText($xMOD, $yMOD, $line); + $this-> + ($xMOD, $yMOD, $line); $this->drawInternal( $xMOD, $yMOD, @@ -387,10 +388,16 @@ protected function strokeText($x, $y, $text) { $size = $this->strokeSize; if ($size <= 0) return; - for ($c1 = $x - $size; $c1 <= $x + $size; $c1++) { - for ($c2 = $y - $size; $c2 <= $y + $size; $c2++) { - $this->drawInternal($c1, $c2, $this->strokeColor, $text); + $c3=0-abs($size); + for ($c1=$x-abs($size);$c1<=$x+abs($size);$c1++) { + $c4=0-abs($size); + for ($c2=$y-abs($size);$c2<=$y+abs($size);$c2++) { + if (($c3*$c3+$c4*$c4)<=$size*$size) { + $this->drawInternal($c1, $c2, $this->strokeColor, $text); + } + $c4++; } + $c3++; } } From 17ed338cc964c7a32c5119a76d26363ac77b28c8 Mon Sep 17 00:00:00 2001 From: Cyril Pereira Date: Tue, 1 Nov 2016 22:55:50 +0100 Subject: [PATCH 2/3] Update Box.php Oups Sorry --- src/Box.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Box.php b/src/Box.php index 170d2b0..3be2438 100644 --- a/src/Box.php +++ b/src/Box.php @@ -323,8 +323,7 @@ public function draw($text) } - $this-> - ($xMOD, $yMOD, $line); + $this->strokeText($xMOD, $yMOD, $line); $this->drawInternal( $xMOD, $yMOD, From ff61772e049c1ede3a3873e96290008d327cbfab Mon Sep 17 00:00:00 2001 From: Cyril Pereira Date: Wed, 22 May 2019 18:03:39 +0200 Subject: [PATCH 3/3] Update composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 6d8a5bb..1adb7d2 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "stil/gd-text", + "name": "funkymed/gd-text", "description": "A class drawing multiline and aligned text on pictures. Uses GD extension.", "license": "MIT", "require": {