diff options
author | Matthias Clasen <mclasen@redhat.com> | 2021-05-09 00:37:13 +0000 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2021-05-09 00:37:13 +0000 |
commit | 736b687b92f93b268fccdf727f1cfd259bd903ed (patch) | |
tree | 939c02f905665d7eb2ac8f2460d938c5826e1100 | |
parent | 7a88d0c6601d5fef4a0850a83145b3b971b51e37 (diff) | |
parent | d476d2a944500f8553a2c1d1054df37363f47460 (diff) | |
download | pango-736b687b92f93b268fccdf727f1cfd259bd903ed.tar.gz |
Merge branch 'word-break-hyphens' into 'master'
Don't insert hyphens at word breaks
Closes #558
See merge request GNOME/pango!323
-rw-r--r-- | pango/pango-layout.c | 3 | ||||
-rw-r--r-- | subprojects/gobject-introspection.wrap | 2 | ||||
-rw-r--r-- | tests/layouts/valid-4.expected | 4 | ||||
-rw-r--r-- | tests/test-layout.c | 2 |
4 files changed, 7 insertions, 4 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; diff --git a/subprojects/gobject-introspection.wrap b/subprojects/gobject-introspection.wrap index 7177b663..46359e23 100644 --- a/subprojects/gobject-introspection.wrap +++ b/subprojects/gobject-introspection.wrap @@ -5,6 +5,6 @@ push-url=ssh://git@gitlab.gnome.org:GNOME/gobject-introspection.git revision=master depth=1 -[provides] +[provide] dependency_names = gobject-introspection-1.0 program_names = g-ir-scanner diff --git a/tests/layouts/valid-4.expected b/tests/layouts/valid-4.expected index 66796cb5..2534b6fc 100644 --- a/tests/layouts/valid-4.expected +++ b/tests/layouts/valid-4.expected @@ -23,11 +23,11 @@ i=6, index=152, paragraph-start=1, dir=ltr '' --- runs -i=1, index=0, chars=30, level=0, gravity=south, flags=4, font=OMITTED, script=latin, language=en-us, 'This paragraph should actual' +i=1, index=0, chars=30, level=0, gravity=south, flags=0, font=OMITTED, script=latin, language=en-us, 'This paragraph should actual' i=2, index=32, no run, line end i=3, index=32, chars=31, level=0, gravity=south, flags=0, font=OMITTED, script=latin, language=en-us, 'ly have multiple lines, unlike ' i=4, index=63, no run, line end -i=5, index=63, chars=29, level=0, gravity=south, flags=4, font=OMITTED, script=latin, language=en-us, 'all the other wannabe äöü pa' +i=5, index=63, chars=29, level=0, gravity=south, flags=0, font=OMITTED, script=latin, language=en-us, 'all the other wannabe äöü pa' i=6, index=96, no run, line end i=7, index=96, chars=27, level=0, gravity=south, flags=0, font=OMITTED, script=latin, language=en-us, 'ragraph tests in this ugh ' i=8, index=124, no run, line end diff --git a/tests/test-layout.c b/tests/test-layout.c index 2ed2a732..9c5d13a0 100644 --- a/tests/test-layout.c +++ b/tests/test-layout.c @@ -368,7 +368,7 @@ main (int argc, char *argv[]) string = g_string_sized_new (0); test_file (argv[1], string); - g_test_message ("%s", string->str); + g_print ("%s", string->str); return 0; } |