diff options
author | Suyuan Chang <suyuan@cloudmosa.com> | 2019-01-25 10:12:24 -0800 |
---|---|---|
committer | Suyuan Chang <suyuan@cloudmosa.com> | 2019-01-25 10:42:48 -0800 |
commit | 30ab4379a60828be1ff570a518be63942389b849 (patch) | |
tree | 30f5b5739d1887c32a10fdc4431834e5a3ed4896 | |
parent | 267d991d9b6f040580a6421a0f52c292ed9304dc (diff) | |
download | pango-30ab4379a60828be1ff570a518be63942389b849.tar.gz |
macOS: Use system `Apple Color Emoji` font for emoji characters.
-rw-r--r-- | pango/pangocoretext-fontmap.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/pango/pangocoretext-fontmap.c b/pango/pangocoretext-fontmap.c index 6fc8a279..b4654268 100644 --- a/pango/pangocoretext-fontmap.c +++ b/pango/pangocoretext-fontmap.c @@ -1323,7 +1323,8 @@ pango_core_text_font_map_load_fontset (PangoFontMap *fontmap, if (G_UNLIKELY (!fontset)) { - /* If no font(set) could be loaded, we fallback to "Sans", + /* If no font(set) could be loaded, we fallback to "Apple Color + * Emoji" for emoji font, fallback to "Sans" for other fonts, * which should always work on Mac. We try to adhere to the * requested style at first. */ @@ -1333,7 +1334,10 @@ pango_core_text_font_map_load_fontset (PangoFontMap *fontmap, pango_font_description_free (key.desc); tmp_desc = pango_font_description_copy_static (desc); - pango_font_description_set_family_static (tmp_desc, "Sans"); + if (strcmp (pango_font_description_get_family (tmp_desc), "emoji") == 0) + pango_font_description_set_family_static (tmp_desc, "Apple Color Emoji"); + else + pango_font_description_set_family_static (tmp_desc, "Sans"); pango_core_text_fontset_key_init (&key, ctfontmap, context, tmp_desc, language); |