[pango/ligature-caret-rtl-fixes: 4/7] Take kerning into account for ligature carets




commit ef66e45acb4eb4d3d675e4eb735178c6b5adf623
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Aug 27 10:27:25 2021 -0400

    Take kerning into account for ligature carets
    
    The ligature caret positions returned by
    hb_ot_layout_get_ligature_carets are 'unshaped' metrics.
    We need to take the kerning into account that is applied
    during shaping, and shows up in the glyphstring as x_offset.

 pango/glyphstring.c | 3 +++
 1 file changed, 3 insertions(+)
---
diff --git a/pango/glyphstring.c b/pango/glyphstring.c
index 74462d26..cda4cf40 100644
--- a/pango/glyphstring.c
+++ b/pango/glyphstring.c
@@ -538,10 +538,13 @@ pango_glyph_string_index_to_x (PangoGlyphString *glyphs,
             *x_pos = end_xpos + caret;
           else
             *x_pos = start_xpos + caret;
+          *x_pos += glyphs->glyphs[glyph_pos].geometry.x_offset;
           return;
         }
     }
 
+fallback:
+
   *x_pos = ((cluster_chars - cluster_offset) * start_xpos +
             cluster_offset * end_xpos) / cluster_chars;
 }


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