Answer the question
In order to leave comments, you need to log in
How to generate rubber image?
Hello!
I'm trying to accomplish the following task:
Using ImageMagick, take the finished image and draw a rectangle with arbitrary text (taken from the form) on it.
So, if there are too many characters, the text does not fit.
How can I make it so that the font size changes for normal display?
Thanks for the help.
Answer the question
In order to leave comments, you need to log in
Apparently you need this . If there is "a lot" of text, we make the font size smaller by one, and so on until there is no more "a lot" of it.
In general, the decision very much depends on how exactly you do it.
With ImageMagic as an executable program, this is done by specifying the -size parameter: www.imagemagick.org/Usage/text/#label_bestfit
This solution makes sense if you call convert from PHP via exec() or shell_exec()
If you say about the ImageMagick functions in PHP, there is no similar possibility, and the easiest way is to generate an empty image with text of a known large size, and then, having obtained the size of the image that you want to provide text, reduce the image of the text and overlay it on the target image.
1. Increase the height of the entire header, not each element individually. Elements can be beautifully animated through opacity.
2. Animate appearance with CSS, not with js
Now it looks really awful.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question