Commit 5eaac683 authored by Naohiro KORIYAMA's avatar Naohiro KORIYAMA Committed by Felix Paul Kühne

macosx: fixed font selector panel on certain setups

Signed-off-by: default avatarFelix Paul Kühne <fkuehne@videolan.org>
(cherry picked from commit 1bff0b7fe088ebbb50837b484df44c9f4467526b)
parent 10bab14c
...@@ -1206,12 +1206,11 @@ static inline void save_module_list( intf_thread_t * p_intf, id object, const ch ...@@ -1206,12 +1206,11 @@ static inline void save_module_list( intf_thread_t * p_intf, id object, const ch
- (IBAction)showFontPicker:(id)sender - (IBAction)showFontPicker:(id)sender
{ {
char * font = config_GetPsz( p_intf, "freetype-font" ); char * font = config_GetPsz( p_intf, "freetype-font" );
NSString * fontFamilyName = font ? [NSString stringWithUTF8String: font] : nil; NSString * fontName = font ? [NSString stringWithUTF8String: font] : nil;
free(font); free(font);
if( fontFamilyName ) if( fontName )
{ {
NSFontDescriptor * fd = [NSFontDescriptor fontDescriptorWithFontAttributes:nil]; NSFont * font = [NSFont fontWithName:fontName size:0.0];
NSFont * font = [NSFont fontWithDescriptor:[fd fontDescriptorWithFamily:fontFamilyName] textTransform:nil];
[[NSFontManager sharedFontManager] setSelectedFont:font isMultiple:NO]; [[NSFontManager sharedFontManager] setSelectedFont:font isMultiple:NO];
} }
[[NSFontManager sharedFontManager] setTarget: self]; [[NSFontManager sharedFontManager] setTarget: self];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment