[pango/pango-1-44] Improve letterspacing with marks



commit 8e26d43f6713d52b1e5b93c0c38157b4d36d5fb3
Author: Matthias Clasen <mclasen redhat com>
Date:   Wed Mar 17 22:49:38 2021 -0400

    Improve letterspacing with marks
    
    harfbuzz puts marks into their own clusters, so we need
    to work a little harder to keep non-spacing marks placed
    over their base character.
    
    Fixes: #541
    
    (cherry-picked from commit fdc432bc)

 pango/pango-glyph-item.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
---
diff --git a/pango/pango-glyph-item.c b/pango/pango-glyph-item.c
index eb880608..a9f26aeb 100644
--- a/pango/pango-glyph-item.c
+++ b/pango/pango-glyph-item.c
@@ -751,7 +751,16 @@ pango_glyph_item_letter_space (PangoGlyphItem *glyph_item,
        have_cluster = pango_glyph_item_iter_next_cluster (&iter))
     {
       if (!log_attrs[iter.start_char].is_cursor_position)
-        continue;
+        {
+          if (glyphs[iter.start_glyph].geometry.width == 0)
+            {
+              if (iter.start_glyph < iter.end_glyph) /* LTR */
+                glyphs[iter.start_glyph].geometry.x_offset -= space_right;
+              else
+                glyphs[iter.start_glyph].geometry.x_offset += space_left;
+            }
+          continue;
+        }
 
       if (iter.start_glyph < iter.end_glyph) /* LTR */
        {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]