summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2021-08-27 22:43:49 -0400
committerMatthias Clasen <mclasen@redhat.com>2022-01-28 09:03:03 -0500
commitb6fb2dca779a4e0f29f9df1d36ded6b44dd5e28a (patch)
tree056583061d509110e7e47c19a8e7e06765dbe039
parent7f4b1306810fb50a08c857ba6e8070573e785b89 (diff)
downloadpango-b6fb2dca779a4e0f29f9df1d36ded6b44dd5e28a.tar.gz
test-shape: Use a simple fontmap
This is experimental to see how far we can take this.
-rw-r--r--tests/test-shape.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/tests/test-shape.c b/tests/test-shape.c
index 9380976f..26dce98c 100644
--- a/tests/test-shape.c
+++ b/tests/test-shape.c
@@ -33,7 +33,7 @@
#include <pango/pangocairo.h>
#include "test-common.h"
-
+static PangoHbFontMap *fontmap;
static PangoContext *context;
gboolean opt_hex_chars;
@@ -197,6 +197,9 @@ test_file (const gchar *filename, GString *string)
PangoGlyphItem glyph_item;
int i;
+ g_assert_nonnull (item->analysis.font);
+ g_assert_true (strcmp (G_OBJECT_TYPE_NAME (item->analysis.font), "PangoHbFont") == 0);
+
glyphs = pango_glyph_string_new ();
/* FIXME: get log attrs */
pango_shape_item (item, text, length, NULL, glyphs, 0);
@@ -410,7 +413,12 @@ main (int argc, char *argv[])
g_test_init (&argc, &argv, NULL);
- context = pango_font_map_create_context (pango_cairo_font_map_get_default ());
+ fontmap = pango_hb_font_map_new ();
+ path = g_test_build_filename (G_TEST_DIST, "fonts", "Cantarell-VF.otf", NULL);
+ pango_hb_font_map_add_file (fontmap, path);
+ g_free (path);
+
+ context = pango_font_map_create_context (PANGO_FONT_MAP (fontmap));
/* allow to easily generate expected output for new test cases */
if (argc > 1)