Search code examples
nsstringnsfontpanelnsfontnsfontmanager

Name and size from NSFont


i've tried to find something in the Internet, but right now I don't have an answer, so it would be great if you can help me! So far I have a NSFont object, but I would like the name (as NSString) and size of the font, so I can output that! It's like

[NSFont fontWithName:@"Menlo" size:11];

only backwards, so I get the name "Menlo" and as size 11.

Thanks for help! Xcoder from Germany


Solution

  • The name and size of NSFont are variables with setters and getters (@property) so you can easily get them:

    object.fontName;
    object.systemSize;