From a6ffe09f3dacab145abdf4da8025b6040fb69bb0 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Wed, 1 Sep 2021 10:47:04 -0400 Subject: Add docs for new attributes --- docs/baseline-shift-dark.png | Bin 0 -> 14806 bytes docs/baseline-shift-light.png | Bin 0 -> 10055 bytes docs/baseline-shift.svg | 740 ++++++++++++++++++++++++++++++++++++++++++ docs/meson.build | 2 + docs/pango.toml.in | 2 + docs/pango_markup.md | 10 + pango/pango-attributes.c | 27 ++ 7 files changed, 781 insertions(+) create mode 100644 docs/baseline-shift-dark.png create mode 100644 docs/baseline-shift-light.png create mode 100644 docs/baseline-shift.svg diff --git a/docs/baseline-shift-dark.png b/docs/baseline-shift-dark.png new file mode 100644 index 00000000..72039c46 Binary files /dev/null and b/docs/baseline-shift-dark.png differ diff --git a/docs/baseline-shift-light.png b/docs/baseline-shift-light.png new file mode 100644 index 00000000..5bd08493 Binary files /dev/null and b/docs/baseline-shift-light.png differ diff --git a/docs/baseline-shift.svg b/docs/baseline-shift.svg new file mode 100644 index 00000000..3685f0fa --- /dev/null +++ b/docs/baseline-shift.svg @@ -0,0 +1,740 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + V3 + + Baseline +shift + + + + + + + + + + + + diff --git a/docs/meson.build b/docs/meson.build index ac2a2257..2471f09e 100644 --- a/docs/meson.build +++ b/docs/meson.build @@ -42,6 +42,8 @@ pango_content_files = [ 'cursor-positions-dark.png', 'glyphstring-positions-light.png', 'glyphstring-positions-dark.png', + 'baseline-shift-light.png', + 'baseline-shift-dark.png', ] doc_conf = configuration_data() diff --git a/docs/pango.toml.in b/docs/pango.toml.in index 01173997..b3ca2bc6 100644 --- a/docs/pango.toml.in +++ b/docs/pango.toml.in @@ -100,4 +100,6 @@ content_images = [ "cursor-positions-dark.png", "glyphstring-positions-light.png", "glyphstring-positions-dark.png", + "baseline-shift-light.png", + "baseline-shift-dark.png", ] diff --git a/docs/pango_markup.md b/docs/pango_markup.md index 287bbc56..c9561fdf 100644 --- a/docs/pango_markup.md +++ b/docs/pango_markup.md @@ -152,6 +152,16 @@ rise negative for subscript, positive for superscript. Support for specifying rise in points was added in Pango 1.50. +baseline_shift +: Vertical displacement. In contrast to rise, baseline_shift attributes are cumulative. + The value can be a length in Pango units or in points (e.g. '5pt'), or 'superscript' + or 'subscript'. Available since 1.50. + +font_scale: +: Font size change. The possible values are 'superscript' or 'subscript'. This is + similar to the font_size values 'smaller' or 'larger', but uses font metrics to + find the new size. Available since 1.50. + strikethrough : 'true' or 'false' whether to strike through the text. diff --git a/pango/pango-attributes.c b/pango/pango-attributes.c index 65af8f3b..a87c661e 100644 --- a/pango/pango-attributes.c +++ b/pango/pango-attributes.c @@ -931,9 +931,19 @@ pango_attr_rise_new (int rise) * * Create a new baseline displacement attribute. * + * The effect of this attribute is to shift the baseline of a run, + * relative to the run of preceding run. + * + * + * + * Baseline Shift + * + * Return value: (transfer full): the newly allocated * `PangoAttribute`, which should be freed with * [method@Pango.Attribute.destroy] + * + * Since: 1.50 */ PangoAttribute * pango_attr_baseline_shift_new (int rise) @@ -948,6 +958,23 @@ pango_attr_baseline_shift_new (int rise) return pango_attr_int_new (&klass, (int)rise); } +/** + * pango_attr_font_scale_new: + * @scale: a `PangoFontScale` value, which indicates font size change relative + * to the size of the previous run. + * + * + * Create a new font scale attribute. + * + * The effect of this attribute is to change the font size of a run, + * relative to the size of preceding run. + * + * Return value: (transfer full): the newly allocated + * `PangoAttribute`, which should be freed with + * [method@Pango.Attribute.destroy] + * + * Since: 1.50 + */ PangoAttribute * pango_attr_font_scale_new (PangoFontScale scale) { -- cgit v1.2.1