summaryrefslogtreecommitdiff
path: root/pango/pango-attributes.h
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2021-08-29 00:10:03 -0400
committerMatthias Clasen <mclasen@redhat.com>2021-08-31 14:29:56 -0400
commit303b4fb73eb8848d18abbda4d151461bd86f1000 (patch)
tree44024e2ec8933eef1a7a3d62ffc2d35264104634 /pango/pango-attributes.h
parente382a65301847bb432c1bf3f9774ef48e1ec4734 (diff)
downloadpango-303b4fb73eb8848d18abbda4d151461bd86f1000.tar.gz
Implement baseline shifts
Add a new baseline-shift attribute, which is similar to rise, but accumulates. In addition, it supports font- relative values such as superscript and subscript. We implement support for this by computing baseline shifts for run during line post-processing, and storing them in the runs. The renderer now takes these shifts into account when rendering layout lines.
Diffstat (limited to 'pango/pango-attributes.h')
-rw-r--r--pango/pango-attributes.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/pango/pango-attributes.h b/pango/pango-attributes.h
index 613aa021..1c9df2c5 100644
--- a/pango/pango-attributes.h
+++ b/pango/pango-attributes.h
@@ -79,6 +79,7 @@ typedef struct _PangoAttrFontFeatures PangoAttrFontFeatures;
* @PANGO_ATTR_ABSOLUTE_LINE_HEIGHT: line height ([struct@Pango.AttrInt]). Since: 1.50
* @PANGO_ATTR_WORD: override segmentation to classify the range of the attribute as a single word ([struct@Pango.AttrInt]). Since 1.50
* @PANGO_ATTR_SENTENCE: override segmentation to classify the range of the attribute as a single sentence ([struct@Pango.AttrInt]). Since 1.50
+ * @PANGO_ATTR_BASELINE_SHIFT: baseline displacement ([struct@Pango.AttrSize]). Since 1.50
*
* The `PangoAttrType` distinguishes between different types of attributes.
*
@@ -125,6 +126,7 @@ typedef enum
PANGO_ATTR_TEXT_TRANSFORM, /* PangoAttrInt */
PANGO_ATTR_WORD, /* PangoAttrInt */
PANGO_ATTR_SENTENCE, /* PangoAttrInt */
+ PANGO_ATTR_BASELINE_SHIFT, /* PangoAttrSize */
} PangoAttrType;
/**
@@ -227,6 +229,23 @@ typedef enum {
} PangoTextTransform;
/**
+ * PangoBaselineShift:
+ * @PANGO_BASELINE_SHIFT_SUPERSCRIPT: Shift the baseline to the superscript position,
+ * relative to the previous run
+ * @PANGO_BASELINE_SHIFT_SUBSCRIPT: Shift the baseline to the subscript position,
+ * relative to the previous run
+ *
+ * An enumeration that affects baseline shifts between runs.
+ *
+ * Since: 1.50
+ */
+typedef enum {
+ PANGO_BASELINE_SHIFT_NONE,
+ PANGO_BASELINE_SHIFT_SUPERSCRIPT,
+ PANGO_BASELINE_SHIFT_SUBSCRIPT,
+} PangoBaselineShift;
+
+/**
* PANGO_ATTR_INDEX_FROM_TEXT_BEGINNING:
*
* Value for @start_index in `PangoAttribute` that indicates
@@ -515,6 +534,8 @@ PangoAttribute * pango_attr_strikethrough_color_new (guint16
guint16 blue);
PANGO_AVAILABLE_IN_ALL
PangoAttribute * pango_attr_rise_new (int rise);
+PANGO_AVAILABLE_IN_1_50
+PangoAttribute * pango_attr_baseline_shift_new (int shift);
PANGO_AVAILABLE_IN_ALL
PangoAttribute * pango_attr_scale_new (double scale_factor);
PANGO_AVAILABLE_IN_1_4