diff options
Diffstat (limited to 'pango/pangocoretext-fontmap.c')
-rw-r--r-- | pango/pangocoretext-fontmap.c | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/pango/pangocoretext-fontmap.c b/pango/pangocoretext-fontmap.c index 1b64f626..27132c4d 100644 --- a/pango/pangocoretext-fontmap.c +++ b/pango/pangocoretext-fontmap.c @@ -1593,19 +1593,27 @@ pango_core_text_fontset_new (PangoCoreTextFontsetKey *key, /* Add the cascade list for this language */ #if defined(MAC_OS_X_VERSION_10_8) && MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_8 { - CFArrayRef language_pref_list; + CFArrayRef language_pref_list = NULL; CFStringRef languages[1]; - languages[0] = CFStringCreateWithCString (NULL, - pango_language_to_string (key->language), - kCFStringEncodingASCII); - language_pref_list = CFArrayCreate (kCFAllocatorDefault, - (const void **) languages, - 1, - &kCFTypeArrayCallBacks); + if (key->language) + { + languages[0] = CFStringCreateWithCString (NULL, + pango_language_to_string (key->language), + kCFStringEncodingASCII); + language_pref_list = CFArrayCreate (kCFAllocatorDefault, + (const void **) languages, + 1, + &kCFTypeArrayCallBacks); + } + fontset->cascade_list = CTFontCopyDefaultCascadeListForLanguages (pango_core_text_font_get_ctfont (best_font), language_pref_list); - CFRelease (languages[0]); - CFRelease (language_pref_list); + + if (language_pref_list) + { + CFRelease (languages[0]); + CFRelease (language_pref_list); + } } #else /* There is unfortunately no public API to retrieve the cascade list |