I use -[NSString sizeWithFont] to get the height of the text. The character 't' is clearly higher than 'm', but -sizeWithFont returns the same height for both of these lines. Here is the code:
UIFont* myFont = [UIFont fontWithName:@"Helvetica" size:1000.0]; NSString* myStr = @"m"; CGSize mySize = [myStr sizeWithFont:myFont];
With 'm', as shown, it returns {834, 1151} . Instead of myStr = @"t" it is {278, 1151} . Smaller widths are displayed as expected, but not height.
Is there any other function used for dense text wrapping? I am ideally looking for something that is equivalent to Android Paint.getTextBounds ().
source share