I'm trying to get my NSMenuItem to have the exact same font/style as the default ones, but I'm having troubles.
Here's my code:
I've attached the output below. On the far left is my menu item. On the far right is the built in date / time menu item I'm trying to copy.
It's close, but not quite right. It's what I was told was the proper font, but it actually looks to me like what was the proper font several OS versions ago (10.4?) It looks a little too sharp... it should be slightly taller and slightly wider. Making it the next size up makes it too tall. Making it bold... actually, I haven't figured out how to bold it (I've tried adding "-bold" to the end of the name of the font, but that seems to result in getting a completely unrelated font to show up...)
Edit: Adding a shadow with offset of 0.5, 0.5 seems a little promising... it doesn't look quite right, though...
Here's my code:
Code:
NSDictionary *attributeDictionary = [NSDictionary dictionaryWithObjectsAndKeys:[NSFont fontWithName:@"LucidaGrande" size:13.0], NSFontAttributeName, nil];
statusItem.attributedTitle = [[NSAttributedString alloc] initWithString:[NSString stringWithFormat:@" Mon Feb 6"] attributes:attributeDictionary];
I've attached the output below. On the far left is my menu item. On the far right is the built in date / time menu item I'm trying to copy.
It's close, but not quite right. It's what I was told was the proper font, but it actually looks to me like what was the proper font several OS versions ago (10.4?) It looks a little too sharp... it should be slightly taller and slightly wider. Making it the next size up makes it too tall. Making it bold... actually, I haven't figured out how to bold it (I've tried adding "-bold" to the end of the name of the font, but that seems to result in getting a completely unrelated font to show up...)
Edit: Adding a shadow with offset of 0.5, 0.5 seems a little promising... it doesn't look quite right, though...
Attachments
Last edited: