nsfont

Name and size from NSFont

家住魔仙堡 提交于 2019-12-10 20:31:45
问题 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 回答1: The name and size of NSFont are variables with setters and getters ( @property ) so you can easily get them

Can't Change NSButton Font

醉酒当歌 提交于 2019-12-08 08:44:26
I'm trying to change the font of a NSButton subclass I've created. I'm able to set the font up when I set up the the actual button using the following code: [button setFont:[NSFont fontWithName:@"Courier" size:15]]; However, when I'm trying to do it later on in my application, it doesn't work. I'm trying to get the user to select a new font; once they've done this, I want to update this button to use the selected font. I know my font-selection process isn't the issue, as I can change the font of other UI items to what the user's chosen. Additionally, I thought the problem was due to the fact

Can't Change NSButton Font

元气小坏坏 提交于 2019-12-08 04:28:25
问题 I'm trying to change the font of a NSButton subclass I've created. I'm able to set the font up when I set up the the actual button using the following code: [button setFont:[NSFont fontWithName:@"Courier" size:15]]; However, when I'm trying to do it later on in my application, it doesn't work. I'm trying to get the user to select a new font; once they've done this, I want to update this button to use the selected font. I know my font-selection process isn't the issue, as I can change the font

Adding a custom font to macOS app using Swift

冷暖自知 提交于 2019-12-06 02:44:35
问题 I followed a bunch of tutorials but it doesn’t work: I simply want to add a custom font to a macOS app. What I tried essentially: Added the .ttf font-files to my project : Target Membership is set and I also made sure that the files are copied using Copy Files within Bundle Phases . After compiling I can see that all files are within the Bundle. So that seems to work perfectly fine. Info.plist : I added Fonts provided by application and created an item for every font-file I want to add

What is the NSFont name for the font 'SF Mono'?

青春壹個敷衍的年華 提交于 2019-12-04 19:00:17
问题 A new font titled 'SF Mono' was introduced with Xcode 8. It's a font that I personally find very readable, and I would like to use it in a NSTextView . However, to set a font for an NSTextView , it is required to use an NSFont object. The problem is that I cannot seem to find the SF Mono font in the list of available fonts through NSFontManager.shared().availableFonts . Does anyone know what the SF Mono 's programmatic name is for the initialisation of an NSFont ( NSFont(name: String, size:

What is the NSFont name for the font 'SF Mono'?

萝らか妹 提交于 2019-12-03 12:20:39
A new font titled 'SF Mono' was introduced with Xcode 8. It's a font that I personally find very readable, and I would like to use it in a NSTextView . However, to set a font for an NSTextView , it is required to use an NSFont object. The problem is that I cannot seem to find the SF Mono font in the list of available fonts through NSFontManager.shared().availableFonts . Does anyone know what the SF Mono 's programmatic name is for the initialisation of an NSFont ( NSFont(name: String, size: CGFloat) ) for its typeface? kennytm "SF Mono" is not a system font. You cannot select SF Mono outside

Unable to add a custom font in Mac app (OSX 10.9+ Xcode5+)

☆樱花仙子☆ 提交于 2019-12-01 04:47:35
I have gone through these SO posts: Embed font in a mac bundle Custom font in a Cocoa application I tried exactly same (rechecked multiple times), but I am not able to add a custom font to my Mac App. All details are shown in attached pictures. Plist is updated: (Tried Fonts and Fonts/ both) In App Bundle it's there in Fonts folder path: But my code is unable to find and read the font : Any help / pointing out my mistake is highly appreciated. Thanks for the comment Is 'PlanerReg' the font name or just the file name? This helped me out to figure the issue. Actually the font file name is

Unable to add a custom font in Mac app (OSX 10.9+ Xcode5+)

那年仲夏 提交于 2019-12-01 02:23:58
问题 I have gone through these SO posts: Embed font in a mac bundle Custom font in a Cocoa application I tried exactly same (rechecked multiple times), but I am not able to add a custom font to my Mac App. All details are shown in attached pictures. Plist is updated: (Tried Fonts and Fonts/ both) In App Bundle it's there in Fonts folder path: But my code is unable to find and read the font : Any help / pointing out my mistake is highly appreciated. 回答1: Thanks for the comment Is 'PlanerReg' the