diff options
| -rw-r--r-- | FL/mac.H | 5 | ||||
| -rw-r--r-- | src/fl_font_mac.cxx | 14 | ||||
| -rw-r--r-- | src/fl_set_fonts_mac.cxx | 4 |
3 files changed, 14 insertions, 9 deletions
@@ -3,7 +3,7 @@ // // Mac header file for the Fast Light Tool Kit (FLTK). // -// Copyright 1998-2011 by Bill Spitzak and others. +// Copyright 1998-2015 by Bill Spitzak and others. // // This library is free software. Distribution and use rights are outlined in // the file "COPYING" which should have been included with this file. If this @@ -71,6 +71,9 @@ typedef CGContextRef Fl_Offscreen; #ifndef MAC_OS_X_VERSION_10_10 #define MAC_OS_X_VERSION_10_10 101000 #endif +#ifndef MAC_OS_X_VERSION_10_11 +#define MAC_OS_X_VERSION_10_11 101100 +#endif #ifndef NSINTEGER_DEFINED // appears with 10.5 in NSObjCRuntime.h #if defined(__LP64__) && __LP64__ diff --git a/src/fl_font_mac.cxx b/src/fl_font_mac.cxx index 0d25f3649..2e55a29a8 100644 --- a/src/fl_font_mac.cxx +++ b/src/fl_font_mac.cxx @@ -3,7 +3,7 @@ // // MacOS font selection routines for the Fast Light Tool Kit (FLTK). // -// Copyright 1998-2011 by Bill Spitzak and others. +// Copyright 1998-2015 by Bill Spitzak and others. // // This library is free software. Distribution and use rights are outlined in // the file "COPYING" which should have been included with this file. If this @@ -30,6 +30,8 @@ static CFMutableDictionaryRef attributes = NULL; #endif const int Fl_X::CoreText_threshold = 100500; // this represents Mac OS 10.5 +// condition when the ATSU API is available at compile time +#define HAS_ATSU (!__LP64__) && MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_11 Fl_Font_Descriptor::Fl_Font_Descriptor(const char* name, Fl_Fontsize Size) { next = 0; @@ -89,7 +91,7 @@ if (fl_mac_os_version >= Fl_X::CoreText_threshold) { } else { #endif -#if ! __LP64__ +#if HAS_ATSU OSStatus err; // fill our structure with a few default values ascent = Size*3/4.; @@ -144,7 +146,7 @@ else { // cause ATSU to find a suitable font to render any chars the current font can't do... ATSUSetTransientFontMatching (layout, true); # endif -#endif//__LP64__ +#endif//HAS_ATSU #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 } #endif @@ -387,7 +389,7 @@ if (fl_mac_os_version >= Fl_X::CoreText_threshold) { return retval; } else { #endif -#if ! __LP64__ +#if HAS_ATSU OSStatus err; Fixed bBefore, bAfter, bAscent, bDescent; ATSUTextLayout layout; @@ -465,7 +467,7 @@ if (fl_mac_os_version >= Fl_X::CoreText_threshold) { } else { #endif -#if ! __LP64__ +#if HAS_ATSU OSStatus err; ATSUTextLayout layout; ByteCount iSize; @@ -533,7 +535,7 @@ static void fl_mac_draw(const char *str, int n, float x, float y, Fl_Graphics_Dr CFRelease(ctline); } else { #endif -#if ! __LP64__ +#if HAS_ATSU OSStatus err; // now collect our ATSU resources ATSUTextLayout layout = driver->font_descriptor()->layout; diff --git a/src/fl_set_fonts_mac.cxx b/src/fl_set_fonts_mac.cxx index 213a3272d..24057ba14 100644 --- a/src/fl_set_fonts_mac.cxx +++ b/src/fl_set_fonts_mac.cxx @@ -3,7 +3,7 @@ // // MacOS font utilities for the Fast Light Tool Kit (FLTK). // -// Copyright 1998-2011 by Bill Spitzak and others. +// Copyright 1998-2015 by Bill Spitzak and others. // // This library is free software. Distribution and use rights are outlined in // the file "COPYING" which should have been included with this file. If this @@ -137,7 +137,7 @@ if(fl_mac_os_version >= Fl_X::CoreText_threshold) { } else { #endif -#if ! __LP64__ +#if (!__LP64__) && MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_11 ItemCount oFontCount, oCountAgain; ATSUFontID *oFontIDs; // How many fonts? |
