Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
fontfamilies のリストを に設定しましたNSPopupButton。選択したフォントプレビューをに設定する方法がわかりませんこのようにしNSTextView てみました
NSPopupButton
NSTextView
NSString *fontstyle = [popup_button titleOfSelectedItem]; NSFont *fontst = [NSFontManager:nil willIncludeFont:fontstyle]; [text_view setFont:fontstyle];
ついにできた...
NSString *fontstyle = [popup_button titleOfSelectedItem]; NSString *fontsize = [pop_size titleOfSelectedItem]; CGFloat fntsize = [fontsize floatValue]; NSFont *regular = [NSFont fontWithName:fontstyle size:fntsize]; [text_view setFont:regular];