I have the bounds of a rectangular box. Is it possible to fit a text (with custom font) into the box while not knowing the text size. I mean, is there a php function which sets the proper text size so that the text is fitted into the user-defined box? I do not need text wrapping.
The only functions I found are imagettfbbox and imagettftext.
imagettfbbox does exactly the opposite(gives the bounds, provided a font size) while imagettftext is used to write text on an image, only if fontSize is known.