How does NSButtonCell do its drawing?
How does NSButtonCell do its drawing?
- Subject: How does NSButtonCell do its drawing?
- From: Uli Kusterer <email@hidden>
- Date: Mon, 21 Jan 2008 19:15:12 +0100
Hi guys,
does anybody know how to draw international and English text in
Cocoa and have it correctly centered vertically? I tried
NSLayoutManager/NSTextStorage/NSTextContainer, but the measurements I
get from -usedRectForTextContainer: always include a highly inflated
descent for Japanese text, which means my text is off towards the top
as soon as it contains a Japanese word.
I presume it's the descent, because when I tried to use ATSUI for
text measuring it gave me the same odd measurements. The descent is
almost as high as the text itself, while for Latin-only text it's
about a quarter. Which is funny, considering Japanese doesn't have any
descenders as far as I know.
It seems that NSButtonCell correctly does its measuring, because
there Japanese text is properly adjusted. Does anyone know what clever
thing NSButtonCell might be doing so it can properly center text
vertically?
Any AppKit engineer happen to hang out here that could have a peek
at the sources, perhaps?
Cheers,
-- M. Uli Kusterer
"The Witnesses of TeachText are everywhere..."
_______________________________________________
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