From 221199b62189c2fd9fdd70fc6d981ddbc4b74bca Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Tue, 9 Jul 2019 09:42:40 -0400 Subject: Don't rely on log attrs for soft hyphen Instead, look at the pre- and post-break text to figure out what is needed. --- pango/pango-layout.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'pango') diff --git a/pango/pango-layout.c b/pango/pango-layout.c index d61b93a5..b6e6ac89 100644 --- a/pango/pango-layout.c +++ b/pango/pango-layout.c @@ -3443,7 +3443,18 @@ break_needs_hyphen (PangoLayout *layout, ParaBreakState *state, int num_chars) { - return layout->log_attrs[state->start_offset + num_chars].is_soft_hyphen; + gunichar *ch; + + if (state->start_offset + num_chars == 0) + return FALSE; + + ch = g_utf8_get_char (layout->text + state->start_offset + num_chars - 1); + + /* Just look for soft hyphen, for now */ + if (ch == 0xAD) + return TRUE; + + return FALSE; } static int -- cgit v1.2.1