使用 imagettftext 在一张图像中使用多种文本颜色
我正在尝试使用 imagettftext 输出一些文本。我可以很容易地做到这一点,以获得全是一种颜色的文本。我想做的是让各个单词具有不同的颜色。使用这个功能可以吗?我的另一个想法是将单个单词作为单独的图像输出,然后将它们连接起来或将它们并排放置在我的最终输出中,但如果可以在 imagettftext 中使用多种颜色,那就容易多了。我试图最终得到一个具有透明背景的图像,我可以将其放置在我正在生成的 .pdf 上。
I am trying to output some text using imagettftext. I can do this easily enough to get text that is all one color. What I would like to do is have individual words be different colors. Is this possible using this function? My other thought was to output individual words as separate images and concatenate them or place them side-by-side on my final output, but it would be much easier if the use of more than one color in imagettftext were possible. I am trying to end up with an image with a transparent background that I can place on a .pdf I'm generating.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论