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




commit 1bd739bc7e9cebe6ebb5a68988a38ec31edc684a
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]