diff options
author | Matthias Clasen <mclasen@redhat.com> | 2021-08-27 10:27:25 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2021-08-27 12:18:26 -0400 |
commit | 0fe6d50dea9ae15086d292cc8af9770606f68b21 (patch) | |
tree | 558906f89acf2648e6adb5d69c92a9e2a0c189c7 | |
parent | 30a3d21c1337030fe6d0484d8899e5ab354b6d28 (diff) | |
download | pango-0fe6d50dea9ae15086d292cc8af9770606f68b21.tar.gz |
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.
-rw-r--r-- | pango/glyphstring.c | 3 |
1 files changed, 3 insertions, 0 deletions
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; } |