diff options
author | Matthias Clasen <mclasen@redhat.com> | 2021-08-29 17:26:52 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2021-08-31 14:29:56 -0400 |
commit | 1f0b5d5b87b61a37bebd393c0d67cce0b4ccdcb9 (patch) | |
tree | 1d9e1e3586a1f3b907385aa1c22a4c3456f147e4 /pango/pango-glyph-item.c | |
parent | 1b73eedc69bc15941f216bff11817b825adb51d8 (diff) | |
download | pango-1f0b5d5b87b61a37bebd393c0d67cce0b4ccdcb9.tar.gz |
Add horizontal displacement
Apply horizontal displacements for superscripts and subscripts
that are provided in font metrics. This noticably improves the
placement of superscripts in italics.
Currently, we only apply these displacements in post-processing,
and ignore the width changes during line-breaking. This could
be improved by moving the baseline handling into the line-breaking
proper.
Diffstat (limited to 'pango/pango-glyph-item.c')
-rw-r--r-- | pango/pango-glyph-item.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/pango/pango-glyph-item.c b/pango/pango-glyph-item.c index c64bfa13..7eb1737d 100644 --- a/pango/pango-glyph-item.c +++ b/pango/pango-glyph-item.c @@ -130,6 +130,8 @@ pango_glyph_item_split (PangoGlyphItem *orig, pango_glyph_string_set_size (orig->glyphs, orig->glyphs->num_glyphs - num_glyphs); new->y_offset = orig->y_offset; + new->start_x_offset = orig->start_x_offset; + new->end_x_offset = -orig->start_x_offset; return new; } @@ -157,6 +159,8 @@ pango_glyph_item_copy (PangoGlyphItem *orig) result->item = pango_item_copy (orig->item); result->glyphs = pango_glyph_string_copy (orig->glyphs); result->y_offset = orig->y_offset; + result->start_x_offset = orig->start_x_offset; + result->end_x_offset = orig->end_x_offset; return result; } |