[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.
pull/690/head
Behdad Esfahbod 7 years ago
parent 7020130665
commit 3f29ea9144
  1. 2
      test/shaping/data/text-rendering-tests/extract-tests.py
  2. 13
      util/options.cc

@ -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)

@ -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}
};

Loading…
Cancel
Save