jeudi 27 juillet 2017

write a text with multiple fonts in PHP

I am currently using Intervention class to write a text on images.

writing is easily possible using text() method:

$img->text('The quick brown fox jumps over the lazy dog.', 120, 100);

Documentation

but my problem is that I want each character of a word with a different font. for example, imagine the word test, each character must use a different font. this is not easily possible since I can't find the position to start the next character, for instance in the word test, when I write t then when I want to call the text() method to write e, I don't know where should I set the position so the character e goes right after t.

How can I get the position of the last character so I can start writing the next character where the last one ends? or is there any other way to achieve this?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire