Finding text's bounding rect in Core Text
- by Mo
I'm trying to find the boundaries of a line of text in Core Text. For simplicity, assume it has a single character.
At the moment I'm using the following method:
line = CTLineCreateWithAttributedString(attrString);
rect = CTLineGetImageBounds(line, context);
It works most of the times, but for some characters, like math italic d (Unicode:…