• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
How does NSButtonCell do its drawing?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: How does NSButtonCell do its drawing?
      • From: Ricky Sharp <email@hidden>
  • Prev by Date: Using WebKit to Download Binary Files
  • Next by Date: Re: Using WebKit to Download Binary Files
  • Previous by thread: Re: Using WebKit to Download Binary Files
  • Next by thread: Re: How does NSButtonCell do its drawing?
  • Index(es):
    • Date
    • Thread