summaryrefslogtreecommitdiff
path: root/pango/pango-markup.c
diff options
context:
space:
mode:
Diffstat (limited to 'pango/pango-markup.c')
-rw-r--r--pango/pango-markup.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/pango/pango-markup.c b/pango/pango-markup.c
index e39730e4..6dce1b2e 100644
--- a/pango/pango-markup.c
+++ b/pango/pango-markup.c
@@ -158,6 +158,10 @@
* not allowed, the range will be kept in a single run as far
* as possible. Breaks are allowed by default.
*
+ * insert_hyphens
+ * : 'true' or 'false' whether to insert hyphens when breaking
+ * lines in the middle of a word. Hyphens are inserted by default.
+ *
* show
* : A value determining how invisible characters are treated.
* Possible values are 'spaces', 'line-breaks', 'ignorables'
@@ -1334,6 +1338,7 @@ span_parse_func (MarkupData *md G_GNUC_UNUSED,
const char *alpha = NULL;
const char *background_alpha = NULL;
const char *allow_breaks = NULL;
+ const char *insert_hyphens = NULL;
const char *show = NULL;
g_markup_parse_context_get_position (context,
@@ -1407,6 +1412,9 @@ span_parse_func (MarkupData *md G_GNUC_UNUSED,
CHECK_ATTRIBUTE (gravity);
CHECK_ATTRIBUTE (gravity_hint);
break;
+ case 'i':
+ CHECK_ATTRIBUTE (insert_hyphens);
+ break;
case 'l':
CHECK_ATTRIBUTE (lang);
CHECK_ATTRIBUTE (letter_spacing);
@@ -1767,6 +1775,16 @@ span_parse_func (MarkupData *md G_GNUC_UNUSED,
add_attribute (tag, pango_attr_allow_breaks_new (b));
}
+ if (G_UNLIKELY (insert_hyphens))
+ {
+ gboolean b = FALSE;
+
+ if (!span_parse_boolean ("insert_hyphens", insert_hyphens, &b, line_number, error))
+ goto error;
+
+ add_attribute (tag, pango_attr_insert_hyphens_new (b));
+ }
+
return TRUE;
error: