diff options
author | Matthias Clasen <mclasen@redhat.com> | 2021-09-01 13:11:51 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2021-09-01 14:01:37 -0400 |
commit | e91c1861efa9cb680d092f50e9f32045607bfcae (patch) | |
tree | 16fa50e8123578cab66559e09d4f566696498fd7 /gtk/gtktextlayout.c | |
parent | 4dc0e67ac741b65b559d262f44980225c0c0beec (diff) | |
download | gtk+-textview-baseline-shift.tar.gz |
wip: Add superscript and subscript to GtkTextTagtextview-baseline-shift
And update the markup demo to just use <sup>.
since it works now.
FIXME: this does not work since it does not accumulate.
Diffstat (limited to 'gtk/gtktextlayout.c')
-rw-r--r-- | gtk/gtktextlayout.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/gtk/gtktextlayout.c b/gtk/gtktextlayout.c index 1873b03d74..bccce5f767 100644 --- a/gtk/gtktextlayout.c +++ b/gtk/gtktextlayout.c @@ -1712,6 +1712,21 @@ add_text_attrs (GtkTextLayout *layout, pango_attr_list_insert (attrs, attr); } + + if (style->baseline_shift) + { + attr = pango_attr_baseline_shift_new (style->baseline_shift); + attr->start_index = start; + attr->end_index = start + byte_count; + + pango_attr_list_insert (attrs, attr); + + attr = pango_attr_font_scale_new (style->baseline_shift); + attr->start_index = start; + attr->end_index = start + byte_count; + + pango_attr_list_insert (attrs, attr); + } } static void |