From 1c16aaced213f4f7b2955bb02a369feea4d0f560 Mon Sep 17 00:00:00 2001 From: Manolo Gouy Date: Tue, 3 Nov 2015 14:36:36 +0000 Subject: 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 --- src/fl_font_mac.cxx | 14 ++++++++------ src/fl_set_fonts_mac.cxx | 4 ++-- 2 files changed, 10 insertions(+), 8 deletions(-) (limited to 'src') 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? -- cgit v1.2.3