On Jul 22, 2009, at 12:46 PM, Thomas Wetmore wrote:

For the layout manager I must calculate the lengths of all the labels to be used on a given form so I can lay them all out together using Apple UI guidelines. To find the sizes of the label text I create an NSAttributedString for each one with the correct font and font size and then ask for the length of this attributed string.

  You mean you ask for its [attributedString size].width?


My question is. Why are labels rendered at 13 font when the NSFont method labelFontSize returns a value of 10? What deep dark secrets do I still have to learn?


  Here's something interesting about your query:

1 - Quit and relaunch IB.
2 - Create a new app document
3 - Drag a "multi-line label" into the window.
4 - Note the size.
5 - Drag a "Label" into the window.
6 - Note the size.

  Now:

1 - Quit and relaunch IB.
2 - Create a new app document
3 - Drag a "Label" into the window.
4 - Note the size.
5 - Drag a "multi-line label" into the window.
6 - Note the size.

  ... I think IB is doing it wrong. :-) File a bug.

If I recall correctly, in earlier IB versions, there used to be a regular text field using + systemFontSizeForControlSize: with NSRegularControlSize and a smaller "label" using the +labelFontSize, but I might just be making that up. I thought I noted when Leopard was in beta that this seems to have changed. Never thought twice about it until now.

--
I.S.


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to