From e8c9f9eaa12383f2fc6d7659b474aeb521f5bf1a Mon Sep 17 00:00:00 2001 From: Manolo Gouy Date: Sun, 24 Jan 2010 08:48:35 +0000 Subject: Better OS X version backwards compatibility of executables. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7025 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/fl_set_fonts_mac.cxx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/fl_set_fonts_mac.cxx b/src/fl_set_fonts_mac.cxx index 84715f1b2..b99a3b55c 100644 --- a/src/fl_set_fonts_mac.cxx +++ b/src/fl_set_fonts_mac.cxx @@ -61,10 +61,14 @@ static int fl_free_font = FL_FREE_FONT; Fl_Font Fl::set_fonts(const char* xstarname) { #pragma unused ( xstarname ) #if defined(__APPLE_COCOA__) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 -if(CTFontCreateWithFontDescriptor != NULL) { +static SInt32 MACsystemVersion = 0; +if(MACsystemVersion == 0) Gestalt(gestaltSystemVersion, &MACsystemVersion); +if(MACsystemVersion >= 0x1050) { +//if(CTFontCreateWithFontDescriptor != NULL) {// CTFontCreateWithFontDescriptor != NULL on 10.4 also! int value[1] = {1}; - CFDictionaryRef dict = CFDictionaryCreate(NULL, (const void **)kCTFontCollectionRemoveDuplicatesOption, - (const void **)&value, 1, NULL, NULL); + CFDictionaryRef dict = CFDictionaryCreate(NULL, + (const void **)kCTFontCollectionRemoveDuplicatesOption, + (const void **)&value, 1, NULL, NULL); CTFontCollectionRef fcref = CTFontCollectionCreateFromAvailableFonts(dict); CFRelease(dict); CFArrayRef arrayref = CTFontCollectionCreateMatchingFontDescriptors(fcref); -- cgit v1.2.3