From 3f29ea91441b2e8c86cf379b4803f638a2e8dcfc Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 10 Jan 2018 02:48:04 +0100 Subject: [PATCH] [util] Add hb-shape --ned For not displaying extra data: no clusters, no advance. Just data pertaining to where glyphs end up on the screen. --- .../data/text-rendering-tests/extract-tests.py | 2 +- util/options.cc | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/test/shaping/data/text-rendering-tests/extract-tests.py b/test/shaping/data/text-rendering-tests/extract-tests.py index cb003db9c..e87177815 100755 --- a/test/shaping/data/text-rendering-tests/extract-tests.py +++ b/test/shaping/data/text-rendering-tests/extract-tests.py @@ -40,6 +40,6 @@ for elt in html.findall(".//*[@class='expected'][@ft:id]", namespaces): assert href[0] == '#' glyphname = '.'.join(href[1:].split('/')[1].split('.')[1:]) glyphs.append((glyphname, x, y)) - print("../fonts/%s:--font-size=1000 --no-clusters --no-advances:%s:%s" % (font, unistr(text), glyphstr(glyphs))) + print("../fonts/%s:--font-size=1000 --ned --font-funcs=ft:%s:%s" % (font, unistr(text), glyphstr(glyphs))) sys.exit(0 if found else 1) diff --git a/util/options.cc b/util/options.cc index dc95b71fa..23360d8f5 100644 --- a/util/options.cc +++ b/util/options.cc @@ -830,6 +830,17 @@ parse_verbose (const char *name G_GNUC_UNUSED, return true; } +static gboolean +parse_ned (const char *name G_GNUC_UNUSED, + const char *arg G_GNUC_UNUSED, + gpointer data G_GNUC_UNUSED, + GError **error G_GNUC_UNUSED) +{ + format_options_t *format_opts = (format_options_t *) data; + format_opts->show_clusters = format_opts->show_advances = false; + return true; +} + void format_options_t::add_options (option_parser_t *parser) { @@ -850,6 +861,8 @@ format_options_t::add_options (option_parser_t *parser) G_OPTION_ARG_NONE, &this->show_clusters, "Do not output cluster indices", nullptr}, {"show-extents", 0, 0, G_OPTION_ARG_NONE, &this->show_extents, "Output glyph extents", nullptr}, {"show-flags", 0, 0, G_OPTION_ARG_NONE, &this->show_flags, "Output glyph flags", nullptr}, + {"ned", 'v', G_OPTION_FLAG_NO_ARG, + G_OPTION_ARG_CALLBACK, (gpointer) &parse_ned, "No Extra Data; Do not output clusters or advances", nullptr}, {"trace", 'V', 0, G_OPTION_ARG_NONE, &this->trace, "Output interim shaping results", nullptr}, {nullptr} };