Line height of drawWithRect:options: seems a bit messed up
Line height of drawWithRect:options: seems a bit messed up
- Subject: Line height of drawWithRect:options: seems a bit messed up
- From: Yung-Luen Lan <email@hidden>
- Date: Thu, 2 Apr 2009 07:31:33 +0800
Hi,
I have some code that draws attributed string to a given location
using given fonts/sizes/styles with [NSAttributedString
drawWithRect:options:].
However, I found that the string were not aways aligned to top on some
fonts when I supply NSStringDrawingUsesLineFragmentOrigin option,
which should use the rect origin as the top left corner of line
fragments.
http://www.flickr.com/photos/yllan/3405764516/
Here is the figure that explains what I encountered: I don't want the
extra red space in this picture.
What option/attribute should I supply to make my string align to the
top edge of bounding box just like how TextEdit does?
The string may contains different fonts/sizes.
I'm also curious about why some fonts have these extra space, but some
fonts don't. Is this because the metric/feature of fonts or the bug of
NSStringDrawing method that calculate the wrong line height?
Any suggestions are welcome.
Regards,
yllan
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden