summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-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);