1 Commits

Author SHA1 Message Date
8f4bd0c6bd fix windows emoji font fallback 2026-07-08 22:18:28 -06:00
3 changed files with 22 additions and 2 deletions

View File

@@ -3515,7 +3515,10 @@ mg_apply_session_font_prefs (session_gui *gui)
} }
if (gui->input_box && prefs.hex_gui_input_style) if (gui->input_box && prefs.hex_gui_input_style)
{
theme_manager_apply_entry_palette (gui->input_box, font); theme_manager_apply_entry_palette (gui->input_box, font);
mg_apply_emoji_fallback_widget (gui->input_box);
}
if (gui->chanview) if (gui->chanview)
chanview_apply_theme (gui->chanview); chanview_apply_theme (gui->chanview);
@@ -4364,7 +4367,7 @@ mg_inputbox_rightclick (GtkEntry *entry, GtkWidget *menu)
static const char *mg_emoji_family_fallback = static const char *mg_emoji_family_fallback =
#ifdef G_OS_WIN32 #ifdef G_OS_WIN32
"Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji, Apple Color Emoji, Twemoji Mozilla, EmojiOne Color"; "Segoe UI Emoji, Noto Color Emoji, Twemoji Mozilla, EmojiOne Color, Apple Color Emoji, Segoe UI Symbol";
#else #else
"Noto Color Emoji, Segoe UI Emoji, Apple Color Emoji, Twemoji Mozilla, EmojiOne Color"; "Noto Color Emoji, Segoe UI Emoji, Apple Color Emoji, Twemoji Mozilla, EmojiOne Color";
#endif #endif
@@ -4470,7 +4473,11 @@ mg_apply_emoji_fallback_widget (GtkWidget *widget)
if (!base_desc) if (!base_desc)
return; return;
#ifdef G_OS_WIN32
desc = mg_fontdesc_with_fallback (base_desc, TRUE);
#else
desc = mg_fontdesc_with_fallback (base_desc, FALSE); desc = mg_fontdesc_with_fallback (base_desc, FALSE);
#endif
pango_font_description_free (base_desc); pango_font_description_free (base_desc);
if (!desc) if (!desc)
return; return;
@@ -4788,6 +4795,7 @@ mg_create_entry (session *sess, GtkWidget *box)
if (prefs.hex_gui_input_style) if (prefs.hex_gui_input_style)
mg_apply_entry_style (entry); mg_apply_entry_style (entry);
mg_apply_emoji_fallback_widget (entry);
mg_apply_entry_scroll_artifact_fix (entry); mg_apply_entry_scroll_artifact_fix (entry);
g_object_set (G_OBJECT (entry), "show-emoji-icon", TRUE, NULL); g_object_set (G_OBJECT (entry), "show-emoji-icon", TRUE, NULL);

View File

@@ -71,7 +71,7 @@ typedef enum
WS_HIDDEN WS_HIDDEN
} WinStatus; } WinStatus;
#if !defined(WIN32) && (defined(HAVE_AYATANA_APPINDICATOR) || defined(HAVE_APPINDICATOR)) && !defined(GDK_WINDOWING_X11) #if !defined(WIN32) && (defined(HAVE_AYATANA_APPINDICATOR) || defined(HAVE_APPINDICATOR))
#define HAVE_APPINDICATOR_BACKEND 1 #define HAVE_APPINDICATOR_BACKEND 1
#else #else
#define HAVE_APPINDICATOR_BACKEND 0 #define HAVE_APPINDICATOR_BACKEND 0

View File

@@ -601,6 +601,10 @@ static PangoFontDescription *
backend_font_open_real (char *name) backend_font_open_real (char *name)
{ {
PangoFontDescription *font; PangoFontDescription *font;
#ifdef WIN32
const char *family;
char *family_list;
#endif
font = pango_font_description_from_string (name); font = pango_font_description_from_string (name);
if (font && pango_font_description_get_size (font) == 0) if (font && pango_font_description_get_size (font) == 0)
@@ -611,6 +615,14 @@ backend_font_open_real (char *name)
if (!font) if (!font)
font = pango_font_description_from_string ("sans 11"); font = pango_font_description_from_string ("sans 11");
#ifdef WIN32
family = pango_font_description_get_family (font);
family_list = g_strdup_printf ("%s, Segoe UI Emoji, Noto Color Emoji, Twemoji Mozilla, Twitter Color Emoji, EmojiOne Color, EmojiOne Mozilla, Noto Emoji, Segoe UI Symbol, Symbola, Unifont",
family && *family ? family : "Sans");
pango_font_description_set_family (font, family_list);
g_free (family_list);
#endif
return font; return font;
} }