mattt/TTTAttributedLabel — Issue #52: Major bug: The last line of text is not drawn on iOS 4 if font size <= 13 and vertical alignment is center or bottom
Author: jasongregori
Created: 2012-02-02 04:41:51+00:00
State: open

**This is especially a problem when you only have one line of text because nothing shows up!**

I don't think the font size is the main issue, I think it's having a small font. So any text I had using the systemFont at a size 13 or smaller would have the bug.

I think this is actually a bug in CoreText. On iOS 5, where this bug doesn't exist, `CTFramesetterSuggestFrameSizeWithConstraints` always returns a width and height that is rounded up to the nearest integers. But on iOS 4 it returns very exact CGFloats. What I think is happening is that the size returned is just barely too small and CoreText doesn't draw everything because it can't fit it in the frame. (I can see when drawing the lines that `CTFrameGetLines` returns 0 lines when you have 1 line of text).

I have a fix for this that simply rounds up the width and height returned by `CTFramesetterSuggestFrameSizeWithConstraints`, but I would like another pair of eyes to check this over before I submit a pull request.

What do you think?