summaryrefslogtreecommitdiff
path: root/pango/break.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2019-07-06 22:54:38 -0400
committerMatthias Clasen <mclasen@redhat.com>2019-07-07 11:28:33 -0400
commit50b1e8532c5211cebd3cea935f9ac91a087d5c35 (patch)
treeaf1ca619f55780c9e64991e1ed97740774fe5eaa /pango/break.c
parent78eb39adf81e2c0de43ae7e3e33ca13cea46330a (diff)
downloadpango-50b1e8532c5211cebd3cea935f9ac91a087d5c35.tar.gz
break: Mark breaks induced by soft hyphens
Use a bit in PangoLogAttr to mark line breaks that are due to soft hyphens; we want to insert hyphens here later, if the break is taken.
Diffstat (limited to 'pango/break.c')
-rw-r--r--pango/break.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/pango/break.c b/pango/break.c
index 11f4079e..13ccbdaf 100644
--- a/pango/break.c
+++ b/pango/break.c
@@ -984,6 +984,7 @@ pango_default_break (const gchar *text,
attrs[i].is_char_break = FALSE;
attrs[i].is_line_break = FALSE;
attrs[i].is_mandatory_break = FALSE;
+ attrs[i].is_soft_hyphen = FALSE;
/* Rule LB1:
assign a line breaking class to each code point of the input. */
@@ -1364,9 +1365,15 @@ pango_default_break (const gchar *text,
case BREAK_ALLOWED:
attrs[i].is_line_break = TRUE;
- break;
+ /* fall through */
case BREAK_ALREADY_HANDLED:
+ if (attrs[i].is_line_break)
+ {
+ /* After Soft Hyphen */
+ if (prev_wc == 0x00AD)
+ attrs[i].is_soft_hyphen = TRUE;
+ }
break;
default: