diff --git a/modules/juce_graphics/juce_graphics.cpp b/modules/juce_graphics/juce_graphics.cpp index d5f60660f7..8599a28fa3 100644 --- a/modules/juce_graphics/juce_graphics.cpp +++ b/modules/juce_graphics/juce_graphics.cpp @@ -57,6 +57,10 @@ #import #import + #if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_3_2 + #error "JUCE no longer supports targets earlier than iOS 3.2" + #endif + #elif JUCE_LINUX #include #include FT_FREETYPE_H diff --git a/modules/juce_graphics/native/juce_mac_Fonts.mm b/modules/juce_graphics/native/juce_mac_Fonts.mm index cffb50f325..f62f915cda 100644 --- a/modules/juce_graphics/native/juce_mac_Fonts.mm +++ b/modules/juce_graphics/native/juce_mac_Fonts.mm @@ -23,9 +23,9 @@ ============================================================================== */ -#if (JUCE_MAC && defined (MAC_OS_X_VERSION_10_5) && MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5 \ - && MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_5) \ - || (JUCE_IOS && defined (__IPHONE_3_0) && __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_3_2) +#if JUCE_IOS || (JUCE_MAC && defined (MAC_OS_X_VERSION_10_5) \ + && MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5 \ + && MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_5) #define JUCE_CORETEXT_AVAILABLE 1 #endif @@ -631,7 +631,7 @@ StringArray Font::findAllTypefaceStyles (const String& family) #else //============================================================================== -// The stuff that follows is a mash-up that supports pre-OSX 10.5 and pre-iOS 3.2 APIs. +// The stuff that follows is a mash-up that supports pre-OSX 10.5 APIs. // (Hopefully all of this can be ditched at some point in the future). //============================================================================== @@ -663,23 +663,6 @@ public: JUCE_AUTORELEASEPOOL renderingTransform = CGAffineTransformIdentity; -#if JUCE_IOS - NSString* fontName = juceStringToNS (style); - fontRef = CGFontCreateWithFontName ((CFStringRef) fontName); - - if (fontRef == 0) - { - // Sometimes, UIFont manages to handle names that CGFontCreateWithFontName fails on... - UIFont* uiFont = [UIFont fontWithName: fontName size: 12]; - fontRef = CGFontCreateWithFontName ((CFStringRef) uiFont.fontName); - } - - const int ascender = abs (CGFontGetAscent (fontRef)); - const float totalHeight = ascender + abs (CGFontGetDescent (fontRef)); - ascent = ascender / totalHeight; - unitsToHeightScaleFactor = 1.0f / totalHeight; - fontHeightToCGSizeFactor = CGFontGetUnitsPerEm (fontRef) / totalHeight; -#else NSDictionary* nsDict = [NSDictionary dictionaryWithObjectsAndKeys: juceStringToNS (name), NSFontFamilyAttribute, juceStringToNS (style), NSFontFaceAttribute, nil]; @@ -731,8 +714,6 @@ public: fontHeightToCGSizeFactor = CGFontGetUnitsPerEm (fontRef) / (float) totalHeight; } #endif - -#endif } ~OSXTypeface() @@ -1067,21 +1048,12 @@ StringArray Font::findAllTypefaceStyles (const String& family) StringArray results; JUCE_AUTORELEASEPOOL - #if JUCE_IOS - NSArray* styles = [UIFont fontNamesForFamilyName: juceStringToNS (family)]; - #else NSArray* styles = [[NSFontManager sharedFontManager] availableMembersOfFontFamily: juceStringToNS (family)]; - #endif for (unsigned int i = 0; i < [styles count]; ++i) { - #if JUCE_IOS - // Fonts are returned in the form of "Arial-BoldMT" - results.add (nsStringToJuce ((NSString*) [styles objectAtIndex: i])); - #else NSArray* style = [styles objectAtIndex: i]; results.add (nsStringToJuce ((NSString*) [style objectAtIndex: 1])); - #endif } return results; @@ -1128,13 +1100,6 @@ Typeface::Ptr Font::getDefaultTypefaceForFont (const Font& font) if (font.getTypefaceStyle() == getDefaultStyle()) newFont.setTypefaceStyle ("Regular"); - #if JUCE_IOS && ! JUCE_CORETEXT_AVAILABLE - // Fonts style names on Cocoa Touch are unusual like "Arial-BoldMT" - // No font will be found for the style of "Regular" so we must modify the style - if (newFont.getTypefaceStyle() == "Regular") - newFont.setTypefaceStyle (faceName); - #endif - return Typeface::createSystemTypefaceFor (newFont); } diff --git a/modules/juce_gui_basics/native/juce_win32_Windowing.cpp b/modules/juce_gui_basics/native/juce_win32_Windowing.cpp index b59fbf5807..011549b952 100644 --- a/modules/juce_gui_basics/native/juce_win32_Windowing.cpp +++ b/modules/juce_gui_basics/native/juce_win32_Windowing.cpp @@ -1285,10 +1285,6 @@ private: L"", type, 0, 0, 0, 0, parentToAddTo, 0, (HINSTANCE) Process::getCurrentModuleInstanceHandle(), 0); - #if JUCE_DIRECT2D - setCurrentRenderingEngine (1); - #endif - if (hwnd != 0) { SetWindowLongPtr (hwnd, 0, 0);