mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Removed compatibility for iOS versions before 3.2.
This commit is contained in:
parent
74a866565c
commit
75f8a6a440
3 changed files with 8 additions and 43 deletions
|
|
@ -57,6 +57,10 @@
|
|||
#import <QuartzCore/QuartzCore.h>
|
||||
#import <CoreText/CoreText.h>
|
||||
|
||||
#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 <ft2build.h>
|
||||
#include FT_FREETYPE_H
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue