|
|
|
@ -19,6 +19,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5)
|
|
|
|
|
|
|
|
|
|
/* CTRunDelegateCreate is supported since MacOS X 10.5, but was only included in the SDKs starting with the 10.9 SDK. */
|
|
|
|
|
#ifndef HAVE_OSX_109_SDK
|
|
|
|
|
extern "C" {
|
|
|
|
|
typedef const struct __CTRunDelegate * CTRunDelegateRef;
|
|
|
|
|
|
|
|
|
|
typedef void (*CTRunDelegateDeallocateCallback) (void* refCon);
|
|
|
|
|
typedef CGFloat (*CTRunDelegateGetAscentCallback) (void* refCon);
|
|
|
|
|
typedef CGFloat (*CTRunDelegateGetDescentCallback) (void* refCon);
|
|
|
|
|
typedef CGFloat (*CTRunDelegateGetWidthCallback) (void* refCon);
|
|
|
|
|
typedef struct {
|
|
|
|
|
CFIndex version;
|
|
|
|
|
CTRunDelegateDeallocateCallback dealloc;
|
|
|
|
|
CTRunDelegateGetAscentCallback getAscent;
|
|
|
|
|
CTRunDelegateGetDescentCallback getDescent;
|
|
|
|
|
CTRunDelegateGetWidthCallback getWidth;
|
|
|
|
|
} CTRunDelegateCallbacks;
|
|
|
|
|
|
|
|
|
|
enum {
|
|
|
|
|
kCTRunDelegateVersion1 = 1,
|
|
|
|
|
kCTRunDelegateCurrentVersion = kCTRunDelegateVersion1
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
extern const CFStringRef kCTRunDelegateAttributeName AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
|
|
|
|
|
|
|
|
|
|
CTRunDelegateRef CTRunDelegateCreate(const CTRunDelegateCallbacks* callbacks, void* refCon) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
|
|
|
|
|
}
|
|
|
|
|
#endif /* HAVE_OSX_109_SDK */
|
|
|
|
|
|
|
|
|
|
/** Cached current locale. */
|
|
|
|
|
static CFAutoRelease<CFLocaleRef> _osx_locale;
|
|
|
|
|
/** CoreText cache for font information, cleared when OTTD changes fonts. */
|
|
|
|
|