diff options
author | wm4 <wm4@nowhere> | 2015-09-01 14:21:31 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-09-01 14:21:31 +0200 |
commit | 77fde472621c6ef263f9b5a7678e3a8677a2eb46 (patch) | |
tree | a6444c86535204eab3d7f5c37eb9a0a8eed1d891 | |
parent | ab08d0799f82a64d80a2ba124b5308b07681adc4 (diff) | |
download | libass-77fde472621c6ef263f9b5a7678e3a8677a2eb46.tar.bz2 libass-77fde472621c6ef263f9b5a7678e3a8677a2eb46.tar.xz |
coretext: always use lazy loading
We already decided that eager loading is too slow. No need to keep
multiple code paths around.
-rw-r--r-- | libass/ass_coretext.c | 30 |
1 files changed, 1 insertions, 29 deletions
diff --git a/libass/ass_coretext.c b/libass/ass_coretext.c index 96c503d..0e94366 100644 --- a/libass/ass_coretext.c +++ b/libass/ass_coretext.c @@ -23,9 +23,6 @@ #include "ass_coretext.h" -#define CT_FONTS_EAGER_LOAD 0 -#define CT_FONTS_LAZY_LOAD !CT_FONTS_EAGER_LOAD - static char *cfstr2buf(CFStringRef string) { const int encoding = kCFStringEncodingUTF8; @@ -201,21 +198,6 @@ static void process_descriptors(ASS_FontProvider *provider, CFArrayRef fontsd) } } -#if CT_FONTS_EAGER_LOAD -static void scan_fonts(ASS_Library *lib, ASS_FontProvider *provider) -{ - - CTFontCollectionRef coll = CTFontCollectionCreateFromAvailableFonts(NULL); - CFArrayRef fontsd = CTFontCollectionCreateMatchingFontDescriptors(coll); - - process_descriptors(provider, fontsd); - - CFRelease(fontsd); - CFRelease(coll); -} -#endif - -#if CT_FONTS_LAZY_LOAD static void match_fonts(ASS_Library *lib, ASS_FontProvider *provider, char *name) { @@ -260,7 +242,6 @@ static void match_fonts(ASS_Library *lib, ASS_FontProvider *provider, CFRelease(descriptors); CFRelease(cfname); } -#endif static char *get_fallback(void *priv, const char *family, uint32_t codepoint) { @@ -288,9 +269,7 @@ static char *get_fallback(void *priv, const char *family, uint32_t codepoint) static ASS_FontProviderFuncs coretext_callbacks = { .check_glyph = check_glyph, .destroy_font = destroy_font, -#if !CT_FONTS_EAGER_LOAD .match_fonts = match_fonts, -#endif .get_fallback = get_fallback, }; @@ -298,12 +277,5 @@ ASS_FontProvider * ass_coretext_add_provider(ASS_Library *lib, ASS_FontSelector *selector, const char *config) { - ASS_FontProvider *provider = - ass_font_provider_new(selector, &coretext_callbacks, NULL); - -#if CT_FONTS_EAGER_LOAD - scan_fonts(lib, provider); -#endif - - return provider; + return ass_font_provider_new(selector, &coretext_callbacks, NULL); } |