sizewithfont

Calculating string sizes on iPhone on a background thread

I've got some somewhat hefty string size calculations happening in my app (each one takes close to 500ms, and happens when the user scrolls to a new "page" in my app (like the Weather app). The delay only happens once per page, as the calculation only needs to be run once (and can even be cached for subsequent launches with the same data...

NSString sizeWithFont: returning inconsistent results? known bug?

I'm trying to create a simple custom UIView wich contain a string drawn with a single font, but where the first character is slightly larger. I thought this would be easily implemented with two UILabel:s placed next to eachother. I use NSString sizeWithFont to measure my string to be able to lay it out correctly. But I noticed that th...

Iphone sizewithfont Doesn't Work????

Hi Guys, Im going crazy here. Need some help. I have the following code: - (CGFloat) tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{ NSString *currentMessage = [FeedMessages objectAtIndex:indexPath.row]; NSLog(currentMessage); UIFont *font = [UIFont systemFontOfSize:14]; NSLog([NSString stringWith...

UILabel sizeWithFont: problem. Clipping italic text.

I have created a UILabel that displays a single large character. Even with clipsToBounds = NO; I still get clipping. See link: http://img341.imageshack.us/img341/5310/screenshot20100814at243.png I used the following code: CGSize fBounds = [myLabel.text sizeWithFont:cFont]; To get what should be the bounding rectangle of the font. ...

sizeWithFont in MultiThread Crash!

sizeWithFont crashed in multithread,this is the debug info: 1 0x00a0df8e in icu::RuleBasedBreakIterator::handleNext 2 0x00a0daff in icu::RuleBasedBreakIterator::next 3 0x00a0d174 in icu::RuleBasedBreakIterator::following 4 0x35879719 in WebCore::nextBreakablePosition 5 0x3587842a in -[NSString(WebStringDrawing) _web_drawInRect:withFont:...

UILabel wrong size calculations on iPhone

Hi all, I am adjusting my old apps to iPhone 4 using the simulator at the moment and I can across a very strange behavior with UILabel drawing and sizeWithFont:constrainedToSize: that I currently see only on the iPhone 4 simulator. I am trying to show the following error text to the user: @"Incorrect user name or password" This text si...