diff options
author | wm4 <wm4@nowhere> | 2015-09-01 14:18:51 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-09-01 14:18:51 +0200 |
commit | ab08d0799f82a64d80a2ba124b5308b07681adc4 (patch) | |
tree | 8f968fc8180f471aec5762f252fc6321b1912bae /libass/ass_coretext.c | |
parent | 888c644420b138875bf5e9f956d926b0be784eae (diff) | |
download | libass-ab08d0799f82a64d80a2ba124b5308b07681adc4.tar.bz2 libass-ab08d0799f82a64d80a2ba124b5308b07681adc4.tar.xz |
fontselect: simplify get_fallback signature
Apparently we only need the font family (and even that isn't used in all
font providers). Drop the others.
Diffstat (limited to 'libass/ass_coretext.c')
-rw-r--r-- | libass/ass_coretext.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/libass/ass_coretext.c b/libass/ass_coretext.c index 00d4c45..96c503d 100644 --- a/libass/ass_coretext.c +++ b/libass/ass_coretext.c @@ -262,10 +262,9 @@ static void match_fonts(ASS_Library *lib, ASS_FontProvider *provider, } #endif -static char *get_fallback(void *priv, ASS_FontProviderMetaData *meta, - uint32_t codepoint) +static char *get_fallback(void *priv, const char *family, uint32_t codepoint) { - char *failed = meta->families[0]; + char *failed = family; CFStringRef name = CFStringCreateWithBytes( 0, (UInt8 *)failed, sizeof(failed), kCFStringEncodingUTF8, false); CTFontRef font = CTFontCreateWithName(name, 0, NULL); @@ -275,7 +274,7 @@ static char *get_fallback(void *priv, ASS_FontProviderMetaData *meta, kCFStringEncodingUTF32LE, false); CTFontRef fb = CTFontCreateForString(font, r, CFRangeMake(0, 1)); CFStringRef cffamily = CTFontCopyFamilyName(fb); - char *family = cfstr2buf(cffamily); + char *res_family = cfstr2buf(cffamily); CFRelease(name); CFRelease(font); @@ -283,7 +282,7 @@ static char *get_fallback(void *priv, ASS_FontProviderMetaData *meta, CFRelease(fb); CFRelease(cffamily); - return family; + return res_family; } static ASS_FontProviderFuncs coretext_callbacks = { |