diff options
author | Matthias Clasen <mclasen@redhat.com> | 2019-07-08 15:27:22 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2019-07-12 18:23:03 -0400 |
commit | ccdc4d81a6d4ee6d21c1471556b62900a856b8c1 (patch) | |
tree | 33aa27b6992663d633ddffa70d42e432700d2608 | |
parent | d67f5d7395a919f0c515e5e82e30b7617c891293 (diff) | |
download | pango-ccdc4d81a6d4ee6d21c1471556b62900a856b8c1.tar.gz |
layout: Don't zero the width of visible space
Don't zero out a line separator at the end of line
if we are showing space or ignorables. And if we
zero out whitespace at the end of the line, make
sure we don't draw anything there by setting the
glyph to EMPTY.
Without this, we are getting the [LS] hex box
rendered on top of the last character in a line,
when the line separator ends up being visible.
-rw-r--r-- | pango/pango-layout.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/pango/pango-layout.c b/pango/pango-layout.c index 9f041670..16df3071 100644 --- a/pango/pango-layout.c +++ b/pango/pango-layout.c @@ -5332,6 +5332,10 @@ zero_line_final_space (PangoLayoutLine *line, PangoGlyphString *glyphs = run->glyphs; int glyph = item->analysis.level % 2 ? 0 : glyphs->num_glyphs - 1; + if ((glyphs->glyphs[glyph].glyph == PANGO_GET_UNKNOWN_GLYPH (0x2028)) && + (layout->shape_flags & (PANGO_SHAPE_SHOW_IGNORABLES | PANGO_SHAPE_SHOW_SPACE))) + return; /* this space is visible */ + /* if the final char of line forms a cluster, and it's * a whitespace char, zero its glyph's width as it's been wrapped */ @@ -5346,6 +5350,7 @@ zero_line_final_space (PangoLayoutLine *line, state->remaining_width += glyphs->glyphs[glyph].geometry.width; glyphs->glyphs[glyph].geometry.width = 0; + glyphs->glyphs[glyph].glyph = PANGO_GLYPH_EMPTY; } /* When doing shaping, we add the letter spacing value for a |