It would be great to have a function to calculate the textwidth to create a dynamic image which depends on the textwidth.
With the latest release this is possible:
$font = new \Intervention\Image\Font('foo');
$font->valign('top');
$size = $font->getBoxSize();
$image = new \Intervention\Image\Image(null, $size['width'], $size['height']);
$font->applyToImage($image);
$image->save('foo.png');
Great! I'll check out. If you want i'll suggest some more features which would nice to have. There is so much more potential in this great library. :)
Go ahead. Proposals are always welcome.
$font = new \Intervention\Image\Font('foo');
$font->valign('top');
$size = $font->getBoxSize();
$image = new \Intervention\Image\Image(null, $size['width'], $size['height']);
$font->applyToImage($image);
$image->save('foo.png');
this is really awesome feature.
please can you tell me how can i use this with Laravel??
imagettfbbox will help you
$font = new \Intervention\Image\Font('foo');
$font->valign('top');
$size = $font->getBoxSize();
$image = new \Intervention\Image\Image(null, $size['width'], $size['height']);
$font->applyToImage($image);
$image->save('foo.png');
How to integrate this in Laravel ?
@vinodjoshi you can use it as:
$font = new \Intervention\Image\Gd\Font('foo');
$font->valign('top');
$size = $font->getBoxSize();
Most helpful comment
$font = new \Intervention\Image\Font('foo');
$font->valign('top');
$size = $font->getBoxSize();
$image = new \Intervention\Image\Image(null, $size['width'], $size['height']);
$font->applyToImage($image);
$image->save('foo.png');
How to integrate this in Laravel ?