[pango/wip-bitmatrix] Get the coverage order early on



commit 163a79523126e12035859fd93e0f9d8e63ee7f34
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat Aug 22 19:01:58 2020 -0400

    Get the coverage order early on
    
    Trigger the generation of the coverage order
    as soon as fontconfig is initialized.

 pango/pangofc-fontmap.c | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)
---
diff --git a/pango/pangofc-fontmap.c b/pango/pangofc-fontmap.c
index 32e9acbe..4a91eab2 100644
--- a/pango/pangofc-fontmap.c
+++ b/pango/pangofc-fontmap.c
@@ -1444,6 +1444,20 @@ wait_for_fc_init (void)
     pango_trace_mark (before, "wait for FcInit", NULL);
 }
 
+static void
+fc_init_done (GObject      *source_object,
+              GAsyncResult *result,
+              gpointer      data)
+{
+  PangoFcFontMap *fcfontmap = PANGO_FC_FONT_MAP (source_object);
+
+  if (fcfontmap->priv->closed)
+    return;
+
+  /* prepare fonts, and trigger coverage calculation */
+  pango_fc_font_map_get_config_fonts (fcfontmap);
+}
+
 static void
 pango_fc_font_map_init (PangoFcFontMap *fcfontmap)
 {
@@ -1479,7 +1493,7 @@ pango_fc_font_map_init (PangoFcFontMap *fcfontmap)
     {
       GTask *task;
 
-      task = g_task_new (fcfontmap, NULL, NULL, NULL);
+      task = g_task_new (fcfontmap, NULL, fc_init_done, NULL);
       g_task_set_name (task, "[pango] FcInit");
       g_task_run_in_thread (task, init_in_thread);
       g_object_unref (task);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]