diff options
Diffstat (limited to 'util')
-rw-r--r-- | util/options.cc | 1 | ||||
-rw-r--r-- | util/options.hh | 7 |
2 files changed, 7 insertions, 1 deletions
diff --git a/util/options.cc b/util/options.cc index db1b2447..584190e0 100644 --- a/util/options.cc +++ b/util/options.cc @@ -396,6 +396,7 @@ shape_options_t::add_options (option_parser_t *parser) {"language", 0, 0, G_OPTION_ARG_STRING, &this->language, "Set text language (default: $LANG)", "langstr"}, {"script", 0, 0, G_OPTION_ARG_STRING, &this->script, "Set text script (default: auto)", "ISO-15924 tag"}, {"utf8-clusters", 0, 0, G_OPTION_ARG_NONE, &this->utf8_clusters, "Use UTF8 byte indices, not char indices", NULL}, + {"normalize-glyphs",0, 0, G_OPTION_ARG_NONE, &this->normalize_glyphs, "Rearrange glyph clusters in nominal order", NULL}, {NULL} }; parser->add_group (entries, diff --git a/util/options.hh b/util/options.hh index 9b7baa71..24852305 100644 --- a/util/options.hh +++ b/util/options.hh @@ -148,6 +148,7 @@ struct shape_options_t : option_group_t num_features = 0; shapers = NULL; utf8_clusters = false; + normalize_glyphs = false; add_options (parser); } @@ -188,7 +189,10 @@ struct shape_options_t : option_group_t hb_bool_t shape (hb_font_t *font, hb_buffer_t *buffer) { - return hb_shape_full (font, buffer, features, num_features, shapers); + hb_bool_t res = hb_shape_full (font, buffer, features, num_features, shapers); + if (normalize_glyphs) + hb_buffer_normalize_glyphs (buffer); + return res; } void shape_closure (const char *text, int text_len, @@ -208,6 +212,7 @@ struct shape_options_t : option_group_t unsigned int num_features; char **shapers; hb_bool_t utf8_clusters; + hb_bool_t normalize_glyphs; }; |