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 : sample image

 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

Popular posts from this blog

java - WrongTypeOfReturnValue exception thrown when unit testing using mockito -

php - Magento - Deleted Base url key -

android - How to disable Button if EditText is empty ? -