[vlc-devel] commit: freetype: LucidaGrande is stored in a different format in Snow Leopard and therefore at another location ( Felix Paul Kühne )

git version control git at videolan.org
Fri Sep 4 12:34:10 CEST 2009


vlc | branch: 1.0-bugfix | Felix Paul Kühne <fkuehne at videolan.org> | Fri Sep  4 12:31:17 2009 +0200| [8b24d62bc4bfc43c8473f2b189b8b8dfea6fe4d9] | committer: Felix Paul Kühne 

freetype: LucidaGrande is stored in a different format in Snow Leopard and therefore at another location

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

 modules/misc/freetype.c |   17 ++++++++++++++++-
 1 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/modules/misc/freetype.c b/modules/misc/freetype.c
index 7e45866..1827420 100644
--- a/modules/misc/freetype.c
+++ b/modules/misc/freetype.c
@@ -51,6 +51,10 @@
 #define FT_MulFix(v, s) (((v)*(s))>>16)
 
 #ifdef __APPLE__
+#import <Carbon/Carbon.h>
+#endif
+
+#ifdef __APPLE__
 #define DEFAULT_FONT "/System/Library/Fonts/LucidaGrande.dfont"
 #define FC_DEFAULT_FONT "Lucida Grande"
 #elif defined( SYS_BEOS )
@@ -328,7 +332,18 @@ static int Create( vlc_object_t *p_this )
         GetWindowsDirectory( psz_fontfile, PATH_MAX + 1 );
         strcat( psz_fontfile, "\\fonts\\arial.ttf" );
 #elif defined(__APPLE__)
-        strcpy( psz_fontfile, DEFAULT_FONT );
+        SInt32 MacVersion;
+        if (Gestalt(gestaltSystemVersion, &MacVersion) == noErr)
+        {
+            if (MacVersion >= 0x1060)
+            {
+                strcpy( psz_fontfile, "/System/Library/Fonts/LucidaGrande.ttc" );
+            }
+            else
+            {
+                strcpy( psz_fontfile, DEFAULT_FONT );
+            }
+        }
 #else
         msg_Err( p_filter, "user didn't specify a font" );
         goto error;




More information about the vlc-devel mailing list