summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2021-10-29 12:17:19 +0000
committerMatthias Clasen <mclasen@redhat.com>2021-10-29 12:17:19 +0000
commitbbacd3787a4b3411daa8e20f841d368576ead851 (patch)
tree5d7da21240e252d98571d1e292c58b4ebdaedc36
parent522101fa2b3dd6a950f1bd289fcca51fd7de8833 (diff)
parent46fc53896c67eaca25da0876ea7ee8160410fdd8 (diff)
downloadpango-bbacd3787a4b3411daa8e20f841d368576ead851.tar.gz
Merge branch 'bilelmoussaoui/gi-annotations' into 'main'
pango: backport an old since annotation See merge request GNOME/pango!488
-rw-r--r--pango/pango-attributes.c2
-rw-r--r--pango/pango-attributes.h12
-rw-r--r--pango/pango-glyph.h2
-rw-r--r--pango/pango-layout.c14
4 files changed, 30 insertions, 0 deletions
diff --git a/pango/pango-attributes.c b/pango/pango-attributes.c
index a87c661e..c929a3d5 100644
--- a/pango/pango-attributes.c
+++ b/pango/pango-attributes.c
@@ -1644,6 +1644,8 @@ pango_attribute_as_float (PangoAttribute *attr)
*
* Returns: (nullable) (transfer none): The attribute as `PangoAttrString`,
* or %NULL if it's not a string attribute
+ *
+ * Since: 1.50
*/
PangoAttrString *
pango_attribute_as_string (PangoAttribute *attr)
diff --git a/pango/pango-attributes.h b/pango/pango-attributes.h
index 59183a60..51b9b077 100644
--- a/pango/pango-attributes.h
+++ b/pango/pango-attributes.h
@@ -232,6 +232,7 @@ typedef enum {
/**
* PangoBaselineShift:
+ * @PANGO_BASELINE_SHIFT_NONE: Leave the baseline unchanged
* @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,
@@ -247,6 +248,17 @@ typedef enum {
PANGO_BASELINE_SHIFT_SUBSCRIPT,
} PangoBaselineShift;
+/**
+ * PangoFontScale:
+ * @PANGO_FONT_SCALE_NONE: Leave the font size unchanged
+ * @PANGO_FONT_SCALE_SUPERSCRIPT: Change the font to a size suitable for superscripts
+ * @PANGO_FONT_SCALE_SUBSCRIPT: Change the font to a size suitable for subscripts
+ *
+ * An enumeration that affects font sizes for superscript
+ * and subscript positioning.
+ *
+ * Since: 1.50
+ */
typedef enum {
PANGO_FONT_SCALE_NONE,
PANGO_FONT_SCALE_SUPERSCRIPT,
diff --git a/pango/pango-glyph.h b/pango/pango-glyph.h
index fae7168c..82ee47c6 100644
--- a/pango/pango-glyph.h
+++ b/pango/pango-glyph.h
@@ -224,6 +224,8 @@ void pango_glyph_string_index_to_x_full (PangoGlyphStrin
* Flags influencing the shaping process.
*
* `PangoShapeFlags` can be passed to [func@Pango.shape_with_flags].
+ *
+ * Since: 1.44
*/
typedef enum {
PANGO_SHAPE_NONE = 0,
diff --git a/pango/pango-layout.c b/pango/pango-layout.c
index 6e761f2c..ba81adf6 100644
--- a/pango/pango-layout.c
+++ b/pango/pango-layout.c
@@ -7509,6 +7509,20 @@ pango_layout_iter_get_baseline (PangoLayoutIter *iter)
return iter->line_extents[iter->line_index].baseline;
}
+/**
+ * pango_layout_iter_get_run_baseline:
+ * @iter: a `PangoLayoutIter`
+ *
+ * Gets the Y position of the current run's baseline, in layout
+ * coordinates.
+ *
+ * Layout coordinates have the origin at the top left of the entire layout.
+ *
+ * The run baseline can be different from the line baseline, for
+ * example due to superscript or subscript positioning.
+ *
+ * Since: 1.50
+ */
int
pango_layout_iter_get_run_baseline (PangoLayoutIter *iter)
{