[pango/visible-things: 39/40] layout: Don't zero the width of visible space
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pango/visible-things: 39/40] layout: Don't zero the width of visible space
- Date: Sun, 14 Jul 2019 03:55:49 +0000 (UTC)
commit 3c03c2cc7f652de2afce740902354b140241c10d
Author: Matthias Clasen <mclasen redhat com>
Date: Mon Jul 8 15:27:22 2019 -0400
layout: Don't zero the width of visible space
Don't zero out a line separator at the end of line
if we turned it into an unknown glyph to render
it.
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.
pango/pango-layout.c | 4 ++++
1 file changed, 4 insertions(+)
---
diff --git a/pango/pango-layout.c b/pango/pango-layout.c
index b8a313d6..76b919c6 100644
--- a/pango/pango-layout.c
+++ b/pango/pango-layout.c
@@ -5337,6 +5337,9 @@ 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))
+ return; /* this LS 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
*/
@@ -5351,6 +5354,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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]