[HarfBuzz] harfbuzz-ng: Branch 'master'
Behdad Esfahbod
behdad at kemper.freedesktop.org
Wed Jan 18 20:37:33 PST 2012
util/options.cc | 42 +++++++++++++++++++++++++++++++++++++++++-
1 file changed, 41 insertions(+), 1 deletion(-)
New commits:
commit 8750abaf8410005facbea8c886c592bead7f959b
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Wed Jan 18 22:47:44 2012 -0500
[util] Add --help-features
Patch from Khaled Hosny.
diff --git a/util/options.cc b/util/options.cc
index 2f201c5..5ded644 100644
--- a/util/options.cc
+++ b/util/options.cc
@@ -391,7 +391,6 @@ shape_options_t::add_options (option_parser_t *parser)
{"direction", 0, 0, G_OPTION_ARG_STRING, &this->direction, "Set text direction (default: auto)", "ltr/rtl/ttb/btt"},
{"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"},
- {"features", 0, 0, G_OPTION_ARG_CALLBACK, (gpointer) &parse_features, "Font features to apply to text", "TODO"},
{NULL}
};
parser->add_group (entries,
@@ -399,6 +398,47 @@ shape_options_t::add_options (option_parser_t *parser)
"Shape options:",
"Options controlling the shaping process",
this);
+
+ const gchar *features_help = "\n"
+ "\n"
+ " Comma-separated list of font features to apply to text\n"
+ "\n"
+ " Features can be enabled or disabled, either globally or limited to\n"
+ " specific byte ranges. The format is Python-esque. Here is how it all\n"
+ " works:\n"
+ "\n"
+ " Syntax: Value: Start: End:\n"
+ "\n"
+ " Setting value:\n"
+ " \"kern\" 1 0 â # Turn feature on\n"
+ " \"+kern\" 1 0 â # Turn feature on\n"
+ " \"-kern\" 0 0 â # Turn feature off\n"
+ " \"kern=0\" 0 0 â # Turn feature off\n"
+ " \"kern=1\" 1 0 â # Turn feature on\n"
+ " \"aalt=2\" 2 0 â # Choose 2nd alternate\n"
+ "\n"
+ " Setting index:\n"
+ " \"kern[]\" 1 0 â # Turn feature on\n"
+ " \"kern[:]\" 1 0 â # Turn feature on\n"
+ " \"kern[5:]\" 1 5 â # Turn feature on, partial\n"
+ " \"kern[:5]\" 1 0 5 # Turn feature on, partial\n"
+ " \"kern[3:5]\" 1 3 5 # Turn feature on, range\n"
+ " \"kern[3]\" 1 3 3+1 # Turn feature on, single char\n"
+ "\n"
+ " Mixing it all:\n"
+ "\n"
+ " \"kern[3:5]=0\" 1 3 5 # Turn feature off for range";
+
+ GOptionEntry entries2[] =
+ {
+ {"features", 0, 0, G_OPTION_ARG_CALLBACK, (gpointer) &parse_features, features_help, "list"},
+ {NULL}
+ };
+ parser->add_group (entries2,
+ "features",
+ "Features options:",
+ "Options controlling the OpenType font features applied",
+ this);
}
void
More information about the HarfBuzz
mailing list