From a67483265888b6a5cad8cf2fdf60a226c96c970f Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Wed, 19 Aug 2020 14:20:41 -0400 Subject: [PATCH] Trigger fontconfig initialization early Add a pango call to create the fontmap already in gtk_init. This will let us hide the cost of FcInit() (which on font-heavy systems can be ~100ms) in a thread, on the pango side. --- gtk/gtkmain.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gtk/gtkmain.c b/gtk/gtkmain.c index f59f1403cc..a517a0e6e7 100644 --- a/gtk/gtkmain.c +++ b/gtk/gtkmain.c @@ -623,6 +623,9 @@ do_pre_parse_initialization (void) slowdown = g_ascii_strtod (env_string, NULL); _gtk_set_slowdown (slowdown); } + + /* Trigger fontconfig initialization early */ + pango_cairo_font_map_get_default (); } static void