开发者

PHP Image Magick / Text-to-PNG - many lines & switch fonts inside image-build

开发者 https://www.devze.com 2022-12-17 23:44 出处:网络
Greetings. For a PHP-Project, I have to build PNG-images where I pass some text and then let imagick generate the image for that text. I did this kind of stuff with success in gd, but only had 1 font

Greetings.

For a PHP-Project, I have to build PNG-images where I pass some text and then let imagick generate the image for that text. I did this kind of stuff with success in gd, but only had 1 font (per text-generatio开发者_JS百科n-block) to play with.

As I want to change between 2+ fonts while generating this textblock I read a lot in Google, but could not find a solution to this problem.

Is there somebody out there who can point me into the correct direction - or even post some sample-code, if possible.

Thanks for that.


I am not sure if I understand your question, but why do you have to use imagick? Can't you just use imagepng, imagettftext and imagecreate.

imagettftext takes a font as the seventh parameter:

http://php.net/manual/en/function.imagettftext.php

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号