objective c - Get default font name in Cocoa for NSMenuItem? -
i using nsattributed nsstring in nsmenuitem, it's font changed compare default font, wants use default font attributed string.
can 1 explain, how find or fetch default font nsmenuitems.
right using :
nsdictionary *attributes = @{ nsfontattributename: [nsfont fontwithname:@"helvetica" size:14], nsforegroundcolorattributename: [nscolor blackcolor], nsparagraphstyleattributename:paragraphstyle };
thanks
to default font of nsmenuitem
use method [nsfont menubarfontofsize:0]
.
nsdictionary *attributes = @{ nsfontattributename: [nsfont menubarfontofsize:0], nsforegroundcolorattributename: [nscolor blackcolor], nsparagraphstyleattributename: paragraphstyle };
which easier in ways.
Comments
Post a Comment