diff options
author | Matthias Clasen <mclasen@redhat.com> | 2019-07-09 09:42:40 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2019-07-09 09:42:40 -0400 |
commit | 221199b62189c2fd9fdd70fc6d981ddbc4b74bca (patch) | |
tree | 228e4d587bbf26cff6b9105ec9be36d3d10c09a9 /pango/pango-layout.c | |
parent | 8ee098c510acdfc7a6cadbce01820b51a2e983d9 (diff) | |
download | pango-221199b62189c2fd9fdd70fc6d981ddbc4b74bca.tar.gz |
Don't rely on log attrs for soft hyphen
Instead, look at the pre- and post-break
text to figure out what is needed.
Diffstat (limited to 'pango/pango-layout.c')
-rw-r--r-- | pango/pango-layout.c | 13 |
1 files changed, 12 insertions, 1 deletions
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 |