summaryrefslogtreecommitdiffstats
path: root/libass
diff options
context:
space:
mode:
authorOleg Oshmyan <chortos@inbox.lv>2017-10-26 22:38:49 +0300
committerOleg Oshmyan <chortos@inbox.lv>2017-10-31 14:00:07 +0200
commitb2bc09603dd90379f13c153cd950d9ab0604e99b (patch)
tree8818c9959ba0be16976cd327a12110c073e235f2 /libass
parent0b232482a4ad0c82aede8ebd346b3148174b3177 (diff)
downloadlibass-b2bc09603dd90379f13c153cd950d9ab0604e99b.tar.bz2
libass-b2bc09603dd90379f13c153cd950d9ab0604e99b.tar.xz
Support Core Text on earlier versions of Mac OS X
Loosely based on behdad/harfbuzz@b96af03c20e46105982b3608b608614403540661. Prefer to link against ApplicationServices to maximize the portability of binaries built on newer versions of macOS. The symbol kCTFontURLAttribute, which is checked in this commit, was introduced in Mac OS X 10.6, the latest of any Core Text symbols that we use. It is essential to our Core Text font provider, so this is the earliest version of Mac OS X where we can support this font provider. The TARGET_OS_IPHONE conditional that this commit adds is necessary to continue supporting iOS in addition to supporting old Mac OS X. On iOS, CoreText.h *must* be included to use Core Text, whereas on old Mac OS X, CoreText.h is not directly accessible and ApplicationServices.h must be used. On modern macOS, either header works. This conditional is also used in HarfBuzz.
Diffstat (limited to 'libass')
-rw-r--r--libass/ass_coretext.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libass/ass_coretext.c b/libass/ass_coretext.c
index a52ead5..661b95c 100644
--- a/libass/ass_coretext.c
+++ b/libass/ass_coretext.c
@@ -20,7 +20,12 @@
#include "ass_compat.h"
#include <CoreFoundation/CoreFoundation.h>
+#include <TargetConditionals.h>
+#if TARGET_OS_IPHONE
#include <CoreText/CoreText.h>
+#else
+#include <ApplicationServices/ApplicationServices.h>
+#endif
#include "ass_coretext.h"