summaryrefslogtreecommitdiff
path: root/pango/pango-glyph-item.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2021-03-17 22:49:38 -0400
committerMarco Trevisan (TreviƱo) <mail@3v1n0.net>2021-05-05 17:19:27 +0200
commit8e26d43f6713d52b1e5b93c0c38157b4d36d5fb3 (patch)
tree72e27e5cce9556c3df4893e9d0fffb548bae5481 /pango/pango-glyph-item.c
parent2b40c8ec42e5c9af9f37147adc632b88d6bbaad3 (diff)
downloadpango-8e26d43f6713d52b1e5b93c0c38157b4d36d5fb3.tar.gz
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)
Diffstat (limited to 'pango/pango-glyph-item.c')
-rw-r--r--pango/pango-glyph-item.c11
1 files changed, 10 insertions, 1 deletions
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 */
{