[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.
This commit is contained in:
Behdad Esfahbod 2018-01-10 02:48:04 +01:00
parent 7020130665
commit 3f29ea9144
2 changed files with 14 additions and 1 deletions

View File

@ -40,6 +40,6 @@ for elt in html.findall(".//*[@class='expected'][@ft:id]", namespaces):
assert href[0] == '#' assert href[0] == '#'
glyphname = '.'.join(href[1:].split('/')[1].split('.')[1:]) glyphname = '.'.join(href[1:].split('/')[1].split('.')[1:])
glyphs.append((glyphname, x, y)) 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) sys.exit(0 if found else 1)

View File

@ -830,6 +830,17 @@ parse_verbose (const char *name G_GNUC_UNUSED,
return true; 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 void
format_options_t::add_options (option_parser_t *parser) 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}, 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-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}, {"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}, {"trace", 'V', 0, G_OPTION_ARG_NONE, &this->trace, "Output interim shaping results", nullptr},
{nullptr} {nullptr}
}; };