I know I can use: CGSize R = [myString sizeWithFont:uiFont];
But the problem is that I do not have UIFont, I use Core Text. So I have CTFontRef.
Any way to get the string size with the givet CTFontRef? I also have font size in double
.
Thank you
you can create a CTFramesetter
then use CTFramesetterSuggestFrameSizeWithConstraints
to measure the dimensions of a string when rendered as text -- using the additional context you provide.
of course, you could create a function which reduces the variables to font+size from there.