[vlc-commits] macosx: Fix font selection when some fonts are disabled

David Fuhrmann git at videolan.org
Sun Jan 25 16:29:16 CET 2015


vlc/vlc-2.2 | branch: master | David Fuhrmann <dfuhrmann at videolan.org> | Sun Jan 25 16:04:29 2015 +0100| [edafec91d2bd140aac17c9d0c76d02e4a5807beb] | committer: Felix Paul Kühne

macosx: Fix font selection when some fonts are disabled

Usage of selectedFont inside changeFont: is not allowed, and its
not needed as all the necessary work is done in convertFont:.

close #13740

(cherry picked from commit bf31a6b4648b803be4d45829e6d29e7d640a6787)
Signed-off-by: Felix Paul Kühne <fkuehne at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.2.git/?a=commit;h=edafec91d2bd140aac17c9d0c76d02e4a5807beb
---

 modules/gui/macosx/simple_prefs.m |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/modules/gui/macosx/simple_prefs.m b/modules/gui/macosx/simple_prefs.m
index ea416e3..98f315d 100644
--- a/modules/gui/macosx/simple_prefs.m
+++ b/modules/gui/macosx/simple_prefs.m
@@ -1286,8 +1286,12 @@ static inline void save_string_list(intf_thread_t * p_intf, id object, const cha
 
 - (void)changeFont:(id)sender
 {
-    NSFont * font = [sender convertFont:[[NSFontManager sharedFontManager] selectedFont]];
-    [o_osd_font_fld setStringValue:[font fontName]];
+    NSFont *someFont = [NSFont systemFontOfSize:12];
+
+    // converts given font to changes in font panel. Original font is irrelevant
+    NSFont *selectedFont = [sender convertFont:someFont];
+
+    [o_osd_font_fld setStringValue:[selectedFont fontName]];
     [self osdSettingChanged:self];
 }
 



More information about the vlc-commits mailing list