I'm trying to place text on an image that is sometimes too wide for the space. Is there a way to squeeze down the text on the X axis with imagettftext or related function. I'd prefer not to reduce the text size if possible.
Render the text as a separate image (get its bounding box to know what size to make it). If it's small enough, just copy it into the main image. If it's too wide, scale it as you copy it.
Since this is being overlayed an image, is there a way to include transparency when making the text?