开发者

PHP imagettftext: bounding boxes of letters superimpose above each other

开发者 https://www.devze.com 2022-12-24 02:00 出处:网络
I\'m writing text-images on the fly with PHPs imagettftext, which works fine so far, but I have a very strange problem.

I'm writing text-images on the fly with PHPs imagettftext, which works fine so far, but I have a very strange problem.

We are using a very italicized font and apparently the bounding boxes of later letters are sometimes superimposing their background over previous letters, thus cutting into them.

Now, I can't seem to find a way to tell imagettftext to use a transpar开发者_运维百科ent background for the font (for the image itself it's not a problem).

So, anyone has an suggestion how to get rid of those cuts? Or will we have to use a less italicized font?


Ha, found the solution right after posting the question.

I had user imagealphablending($image, false) to get a transparent background. When turning it back on right before applying the text, it works just fine.

0

精彩评论

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