ImageMagick best fit text within rectangle?
问题 I have an image like this, with a rectangle at specific coordinates: (for illustratory purposes I put the coordinates of the rectangle and its size and center in there) Now I want to render some text with ImageMagick, so that it fits exactly within the rectangle . If it's a very short (narrow) string, the rectangle's height will be the limiting factor: On the other hand with a long (wide) string, the rectangle's width will determine the size: In either case, independent of how short or long