[librsvg/remove-pangoft2-dependency] Remove pangoft2 depdency from C test code




commit 098aab786eb975ebb57a7f384fd69806d4989077
Author: Sven Neumann <sven svenfoo org>
Date:   Wed Mar 17 22:22:15 2021 +0100

    Remove pangoft2 depdency from C test code
    
    The tests written in C used to set up the fontmap in order to get
    reproducible results for reference tests. Since these tests are now
    part of the Rust test suite, and the remaining tests written in C
    do not exercise text rendering in reference tests, this code isn't
    needed any longer.
    
    This remove the dependency on pangoft2 from the C code, thus paving
    the way for !472.

 tests/api.c        |  1 -
 tests/test-utils.c | 63 ++++++------------------------------------------------
 2 files changed, 7 insertions(+), 57 deletions(-)
---
diff --git a/tests/api.c b/tests/api.c
index 1bb17e79..90d75301 100644
--- a/tests/api.c
+++ b/tests/api.c
@@ -1719,7 +1719,6 @@ main (int argc, char **argv)
     g_test_init (&argc, &argv, NULL);
 
     test_utils_print_dependency_versions ();
-    test_utils_setup_font_map ();
 
     add_pixbuf_tests ();
     add_api_tests ();
diff --git a/tests/test-utils.c b/tests/test-utils.c
index 9a666946..128611f4 100644
--- a/tests/test-utils.c
+++ b/tests/test-utils.c
@@ -7,16 +7,15 @@
 #include <string.h>
 #include <pango/pango.h>
 #include <pango/pangocairo.h>
-#ifdef HAVE_PANGOFT2
-#include <pango/pangofc-fontmap.h>
-#else
-# if !PANGO_VERSION_CHECK (1, 44, 0)
-#  include <hb.h>
-# endif
-# include <ft2build.h>
-# include FT_FREETYPE_H
+
+#if !PANGO_VERSION_CHECK (1, 44, 0)
+# include <hb.h>
 #endif
 
+#include <ft2build.h>
+#include FT_FREETYPE_H
+
+
 /* Compare two buffers, returning the number of pixels that are
  * different and the maximum difference of any single color channel in
  * result_ret.
@@ -235,54 +234,6 @@ test_utils_get_test_data_path (void)
     return data_path;
 }
 
-#ifdef HAVE_PANGOFT2
-static FcConfig *
-create_font_config_for_testing (void)
-{
-    const char *font_paths[] =
-    {
-        "Roboto-Regular.ttf",
-        "Roboto-Italic.ttf",
-        "Roboto-Bold.ttf",
-        "Roboto-BoldItalic.ttf",
-    };
-
-    FcConfig *config = FcConfigCreate ();
-    int i;
-
-    for (i = 0; i < G_N_ELEMENTS(font_paths); i++)
-    {
-        char *font_path = g_test_build_filename (G_TEST_DIST, "resources", font_paths[i], NULL);
-
-        if (!FcConfigAppFontAddFile (config, (const FcChar8 *) font_path))
-        {
-            g_error ("Could not load font file \"%s\" for tests; aborting", font_path);
-        }
-
-        g_free (font_path);
-    }
-
-    return config;
-}
-#endif
-
-void
-test_utils_setup_font_map (void)
-{
-#ifdef HAVE_PANGOFT2
-    FcConfig *config = create_font_config_for_testing ();
-    PangoFontMap *font_map = NULL;
-
-    font_map = pango_cairo_font_map_new_for_font_type (CAIRO_FONT_TYPE_FT);
-    pango_fc_font_map_set_config (PANGO_FC_FONT_MAP (font_map), config);
-    FcConfigDestroy (config);
-
-    pango_cairo_font_map_set_default (PANGO_CAIRO_FONT_MAP (font_map));
-
-    g_object_unref (font_map);
-#endif
-}
-
 void
 test_utils_print_dependency_versions (void)
 {


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