Text methods callback parameter align doesn't center multiline text. I'm using GD library. See the image below.

I'm aware of this problem. Multiline is problematic and needs to be fixed.
Any timespan when this bug is fixed?
@julesbloemen No, sorry.
@kivivuori Did you manage to find a work arround so far?
@julesbloemen I used another library for rendering the text. This one https://github.com/stil/gd-text
I've same problem about centered text.
Hope this will help someone:
$textToBeShown ="The man, the dwarf and the girlguardian";
$img2 = Image::canvas(300,250);
// inserts character where string is to be split into new line (after 15 characters, keeping words intact)
$string = wordwrap($textToBeShown,15,"|");
//create array of lines
$strings = explode("|",$string);
$i=3; //top position of string
//for each line added
foreach($strings as $string){
$img2->text($string, 150, $i, function($font) {
$font->file('fonts/RobotoCondensed-Bold.ttf');
$font->size(40);
$font->color('#826c61');
$font->align('center');
$font->valign('top');
});
$i=$i+42; //shift top postition down 42
}
@setvir Thanks!
Most helpful comment
Hope this will help someone:
$textToBeShown ="The man, the dwarf and the girlguardian";$img2 = Image::canvas(300,250);// inserts character where string is to be split into new line (after 15 characters, keeping words intact)$string = wordwrap($textToBeShown,15,"|");//create array of lines$strings = explode("|",$string);$i=3; //top position of string//for each line addedforeach($strings as $string){$img2->text($string, 150, $i, function($font) {$font->file('fonts/RobotoCondensed-Bold.ttf');$font->size(40);$font->color('#826c61');$font->align('center');$font->valign('top');});$i=$i+42; //shift top postition down 42}