summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2010-01-24 08:48:35 +0000
committerManolo Gouy <Manolo>2010-01-24 08:48:35 +0000
commite8c9f9eaa12383f2fc6d7659b474aeb521f5bf1a (patch)
tree8d572014fd4296b0ade09a0d115cb154fc62045f
parent092c86c7048a6633a0d8c37538d48d2416840ff1 (diff)
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
-rw-r--r--src/fl_set_fonts_mac.cxx10
1 files changed, 7 insertions, 3 deletions
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);