summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2015-11-03 14:36:36 +0000
committerManolo Gouy <Manolo>2015-11-03 14:36:36 +0000
commit1c16aaced213f4f7b2955bb02a369feea4d0f560 (patch)
tree3f920fd563fff8e3845da718396dc80e3ae872cd
parent848744bcf0bce9e5e82274afa3ddce61582e6545 (diff)
The ATSU API (old API for text formatting) has been removed from SDK 10.11.
This fixes STR#3262 git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10878 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
-rw-r--r--FL/mac.H5
-rw-r--r--src/fl_font_mac.cxx14
-rw-r--r--src/fl_set_fonts_mac.cxx4
3 files changed, 14 insertions, 9 deletions
diff --git a/FL/mac.H b/FL/mac.H
index 84728ecc6..d7ad7fb00 100644
--- a/FL/mac.H
+++ b/FL/mac.H
@@ -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?