diff options
author | Matthias Clasen <mclasen@redhat.com> | 2021-08-30 12:44:00 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2021-08-31 14:29:56 -0400 |
commit | a0cb9d5e75a78918ecbf9b71194d8cf229fd3aa7 (patch) | |
tree | f9c012144d5e2fbe58c7fedd02a35ea65d8aa89f /tests/test-layout.c | |
parent | cd390b859f26ffd70beb0a6634e1679e41e1d5fa (diff) | |
download | pango-a0cb9d5e75a78918ecbf9b71194d8cf229fd3aa7.tar.gz |
test-layout: Add a --show-fonts optionbaseline-shift
A bit more natural than the environment variable.
Diffstat (limited to 'tests/test-layout.c')
-rw-r--r-- | tests/test-layout.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/test-layout.c b/tests/test-layout.c index 3320920b..cd60450e 100644 --- a/tests/test-layout.c +++ b/tests/test-layout.c @@ -617,9 +617,24 @@ main (int argc, char *argv[]) GError *error = NULL; const gchar *name; gchar *path; + GOptionContext *option_context; + GOptionEntry entries[] = { + { "show-fonts", '0', 0, G_OPTION_ARG_NONE, &opt_show_font, "Print font names in dumps", NULL }, + { NULL, 0 }, + }; setlocale (LC_ALL, ""); + option_context = g_option_context_new (""); + g_option_context_add_main_entries (option_context, entries, NULL); + g_option_context_set_ignore_unknown_options (option_context, TRUE); + if (!g_option_context_parse (option_context, &argc, &argv, &error)) + { + g_error ("failed to parse options: %s", error->message); + return 1; + } + g_option_context_free (option_context); + if (g_getenv ("PANGO_TEST_SHOW_FONT")) opt_show_font = TRUE; |