[pango/word-break-hyphens: 2/2] layout: Don't insert hyphens at word boundaries




commit 3d8e0bd5a1d1ae2fc9de34f99c109d6b58853b6a
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat May 8 15:09:45 2021 -0400

    layout: Don't insert hyphens at word boundaries
    
    We only want to insert hyphens when we are breaking
    inside a word.
    
    Fixes: #558

 pango/pango-layout.c | 3 +++
 1 file changed, 3 insertions(+)
---
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;
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]