Align attributed string to baseline
Align attributed string to baseline
- Subject: Align attributed string to baseline
- From: Leonardo <email@hidden>
- Date: Fri, 07 Dec 2012 18:40:02 +0100
- Thread-topic: Align attributed string to baseline
Hi,
I am getting serious difficulties at drawing an attributed string within an
attachmentCell and get it aligned on the baseline.
I have a NSTextView. I add an attachment with its attachmentCell.
In the method cellFrameForTextContainer I return a
cell.frame.height = font.ascender - font.descender;
In the method drawWithFrame: of the cell, I draw the string with
drawAtPoint: cellFrame.origin.x, cellFrame.origin.y - font.descender;
It works well with some font and size: the attachment string is aligned with
the rest of the text (with same font and size) in the NSTextView.
E.g. with Futura Medium >= 17 the string is "always" aligned.
But with Futura Medium < 18 the string goes lower than the baseline. Why?
What do I miss there?
Regards
-- Leonardo
_______________________________________________
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