summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@behdad.org>2012-01-18 22:47:44 -0500
committerBehdad Esfahbod <behdad@behdad.org>2012-01-18 22:47:44 -0500
commit8750abaf8410005facbea8c886c592bead7f959b (patch)
tree2ad025a77ca2241805516c1c946ffbf2f38df27b /util
parent889caa52fa1bef61013ec1d127f84d7d5907ef1e (diff)
[util] Add --help-features
Patch from Khaled Hosny.
Diffstat (limited to 'util')
-rw-r--r--util/options.cc42
1 files changed, 41 insertions, 1 deletions
diff --git a/util/options.cc b/util/options.cc
index 2f201c5f..5ded644e 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