[HarfBuzz] harfbuzz: Branch 'master' - 2 commits

Behdad Esfahbod behdad at kemper.freedesktop.org
Tue Nov 13 15:33:56 PST 2012


 util/options.cc |    5 ++++-
 util/options.hh |   12 ++++++++++++
 2 files changed, 16 insertions(+), 1 deletion(-)

New commits:
commit 407f80d62589774f845ef1a6a0a7d841b09d57c6
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Tue Nov 13 15:33:27 2012 -0800

    [util] Add --bot / --eot / --preserve-default-ignorables

diff --git a/util/options.cc b/util/options.cc
index b9f1538..ca621bf 100644
--- a/util/options.cc
+++ b/util/options.cc
@@ -271,6 +271,9 @@ 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"},
+    {"bot",		0, 0, G_OPTION_ARG_NONE,	&this->bot,			"Treat text as beginning-of-paragraph",	NULL},
+    {"eot",		0, 0, G_OPTION_ARG_NONE,	&this->eot,			"Treat text as end-of-paragraph",	NULL},
+    {"preserve-default-ignorables",0, 0, G_OPTION_ARG_NONE,	&this->preserve_default_ignorables,	"Preserve Default-Ignorable characters",	NULL},
     {"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}
diff --git a/util/options.hh b/util/options.hh
index 0f6fce2..be6878b 100644
--- a/util/options.hh
+++ b/util/options.hh
@@ -144,6 +144,7 @@ struct shape_options_t : option_group_t
   shape_options_t (option_parser_t *parser)
   {
     direction = language = script = NULL;
+    bot = eot = preserve_default_ignorables = false;
     features = NULL;
     num_features = 0;
     shapers = NULL;
@@ -165,6 +166,10 @@ struct shape_options_t : option_group_t
     hb_buffer_set_direction (buffer, hb_direction_from_string (direction, -1));
     hb_buffer_set_script (buffer, hb_script_from_string (script, -1));
     hb_buffer_set_language (buffer, hb_language_from_string (language, -1));
+    hb_buffer_set_flags (buffer, (hb_buffer_flags_t) (HB_BUFFER_FLAGS_DEFAULT |
+			 (bot ? HB_BUFFER_FLAG_BOT : 0) |
+			 (eot ? HB_BUFFER_FLAG_EOT : 0) |
+			 (preserve_default_ignorables ? HB_BUFFER_FLAG_PRESERVE_DEFAULT_IGNORABLES : 0)));
   }
 
   void populate_buffer (hb_buffer_t *buffer, const char *text, int text_len,
@@ -213,9 +218,16 @@ struct shape_options_t : option_group_t
     hb_ot_shape_glyphs_closure (font, buffer, features, num_features, glyphs);
   }
 
+  /* Buffer properties */
   const char *direction;
   const char *language;
   const char *script;
+
+  /* Buffer flags */
+  hb_bool_t bot;
+  hb_bool_t eot;
+  hb_bool_t preserve_default_ignorables;
+
   hb_feature_t *features;
   unsigned int num_features;
   char **shapers;
commit 78d41d8d69142ae95928b51215c0c0c5e3f5b3f0
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Tue Nov 13 15:15:09 2012 -0800

    Minor

diff --git a/util/options.cc b/util/options.cc
index ef07e9f..b9f1538 100644
--- a/util/options.cc
+++ b/util/options.cc
@@ -349,7 +349,7 @@ text_options_t::add_options (option_parser_t *parser)
   GOptionEntry entries[] =
   {
     {"text",		0, 0, G_OPTION_ARG_STRING,	&this->text,			"Set input text",			"string"},
-    {"text-file",	0, 0, G_OPTION_ARG_STRING,	&this->text_file,		"Set input text file-name\n\n    If no text is provided, standard input is used for input.",		"filename"},
+    {"text-file",	0, 0, G_OPTION_ARG_STRING,	&this->text_file,		"Set input text file-name\n\n    If no text is provided, standard input is used for input.\n",		"filename"},
     {"text-before",	0, 0, G_OPTION_ARG_STRING,	&this->text_before,		"Set text context before each line",	"string"},
     {"text-after",	0, 0, G_OPTION_ARG_STRING,	&this->text_after,		"Set text context after each line",	"string"},
     {NULL}



More information about the HarfBuzz mailing list