Hi All,

I need to draw image having text using gd library on basis of font selection. User has an option to make text bold/italic. I am using imagettftext to write text on the image.

how can we draw having bold/italic text or is there a way to detect whether selected font supports bold/italic feature.

Please let me know on this.

Thanks in advance

Recommended Answers

All 3 Replies

Usually when you have bold/italic text there will be separate ttf files for the standard font, the bold font and the italic font so just load those as separate fonts and write text using them.

Im not 100% sure but when you are using the GD Library to create an image im sure there is an option to "paste" the text on the image and possibly format when required. Possibly check the GD Library at php.net?

Thanks for your reply.

Usually when you have bold/italic text there will be separate ttf files for the standard font, the bold font and the italic font so just load those as separate fonts and write text using them.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.