]> git.sesse.net Git - vlc/commitdiff
freetype: simply snowleopard-hack for default font
authorFelix Paul Kühne <fkuehne@videolan.org>
Mon, 14 Sep 2009 17:47:10 +0000 (19:47 +0200)
committerFelix Paul Kühne <fkuehne@videolan.org>
Mon, 14 Sep 2009 18:01:48 +0000 (20:01 +0200)
modules/misc/freetype.c

index d583afa0ed2da14dc43729a303a75b7548cb2dc5..82d988784fd4966706531e0ad22149a014cd8628 100644 (file)
@@ -56,6 +56,7 @@
 #ifdef __APPLE__
 #import <Carbon/Carbon.h>
 #define DEFAULT_FONT "/System/Library/Fonts/LucidaGrande.dfont"
+#define DEFAULT_FONT_SNOWLEOPARD "/System/Library/Fonts/LucidaGrande.ttc"
 #define FC_DEFAULT_FONT "Lucida Grande"
 #elif defined( SYS_BEOS )
 #define DEFAULT_FONT "/boot/beos/etc/fonts/ttfonts/Swiss721.ttf"
@@ -325,8 +326,17 @@ static int Create( vlc_object_t *p_this )
     if( !psz_fontfamily || !*psz_fontfamily )
     {
 #ifdef HAVE_FONTCONFIG
+#ifdef __APPLE__
+        SInt32 MacVersion;
+        free( psz_fontfamily);
+        if (Gestalt(gestaltSystemVersion, &MacVersion) == noErr && MacVersion >= 0x1060)
+            psz_fontfamily=strdup( DEFAULT_FONT_SNOWLEOPARD );
+        else
+            psz_fontfamily=strdup( DEFAULT_FONT );
+#else
         free( psz_fontfamily);
         psz_fontfamily=strdup( DEFAULT_FONT );
+#endif
 #else
         free( psz_fontfamily );
         psz_fontfamily = (char *)malloc( PATH_MAX + 1 );
@@ -337,17 +347,10 @@ static int Create( vlc_object_t *p_this )
         strcat( psz_fontfamily, "\\fonts\\arial.ttf" );
 # elif __APPLE__
         SInt32 MacVersion;
-        if (Gestalt(gestaltSystemVersion, &MacVersion) == noErr)
-        {
-            if (MacVersion >= 0x1060)
-            {
-                strcpy( psz_fontfile, "/System/Library/Fonts/LucidaGrande.ttc" );
-            }
-            else
-            {
-                strcpy( psz_fontfile, DEFAULT_FONT );
-            }
-        }
+        if (Gestalt(gestaltSystemVersion, &MacVersion) == noErr && MacVersion >= 0x1060)
+            strcpy( psz_fontfile, DEFAULT_FONT_SNOWLEOPARD );
+        else
+            strcpy( psz_fontfile, DEFAULT_FONT );
 # else
         strcpy( psz_fontfamily, DEFAULT_FONT );
 # endif