I am doing manual drawing of text with CGContextShowTextAtPoint() because this text is being placed over an image and to be readable I draw this text first time with larger white lineWidth and then with smaller black lineWidth, because shadow doesn’t give required readablity effect. Image is not static, so I can’t use any static images instead of text. So I need real text object being drawn. But I also need the font size of this text to change if, for example, length of text is larger then some given value. UILabel has option of auto shrinking text but I don’t know how to make it draw border around each symbol.
So is there any way to autoshrink text manually drawn by CGContextShowTextAtPoint() or at least to measure the length in points of text, drawn with particular font settings?
I am doing manual drawing of text with CGContextShowTextAtPoint() because this text is being
Share
You can draw with core graphics and set a minimum font size to resize the text to fit:
You can also get the size of a text string using this: