summaryrefslogtreecommitdiff
path: root/pango/pango-layout.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2021-05-08 15:09:45 -0400
committerMatthias Clasen <mclasen@redhat.com>2021-05-08 20:24:49 -0400
commitd476d2a944500f8553a2c1d1054df37363f47460 (patch)
tree939c02f905665d7eb2ac8f2460d938c5826e1100 /pango/pango-layout.c
parent62ede003a14b03311885ee873725b8caa5f9ce53 (diff)
downloadpango-d476d2a944500f8553a2c1d1054df37363f47460.tar.gz
layout: Don't insert hyphens at word boundariesword-break-hyphens
We only want to insert hyphens when we are breaking inside a word. Update affected tests (hyphen-or-not shows up in the analysis flags in the output of test-layout). Fixes: #558
Diffstat (limited to 'pango/pango-layout.c')
-rw-r--r--pango/pango-layout.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/pango/pango-layout.c b/pango/pango-layout.c
index fa499ef3..e847e789 100644
--- a/pango/pango-layout.c
+++ b/pango/pango-layout.c
@@ -3611,6 +3611,9 @@ break_needs_hyphen (PangoLayout *layout,
if (state->log_widths_offset + pos == 0)
return FALSE;
+ if (layout->log_attrs[state->start_offset + pos].is_line_break)
+ return FALSE;
+
if (state->need_hyphen[state->log_widths_offset + pos - 1])
return TRUE;