summaryrefslogtreecommitdiff
path: root/pango/pango-attributes.c
diff options
context:
space:
mode:
Diffstat (limited to 'pango/pango-attributes.c')
-rw-r--r--pango/pango-attributes.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/pango/pango-attributes.c b/pango/pango-attributes.c
index 4d7908ff..01683af3 100644
--- a/pango/pango-attributes.c
+++ b/pango/pango-attributes.c
@@ -1555,6 +1555,30 @@ pango_attr_line_height_new_absolute (int height)
}
/**
+ * pango_attr_line_spacing_new:
+ * @spacing: the line spacing, in %PANGO_SCALE-ths of a point
+ *
+ * Spacing to be added to the leading from font metrics,
+ * if not overridden by line spacing attributes.
+ *
+ * This affects the values returned by
+ * [method@Pango.LayoutLine.get_extents],
+ * [method@Pango.LayoutIter.get_line_extents].
+ */
+PangoAttribute *
+pango_attr_line_spacing_new (int spacing)
+{
+ static const PangoAttrClass klass = {
+ PANGO_ATTR_LINE_SPACING,
+ pango_attr_int_copy,
+ pango_attr_int_destroy,
+ pango_attr_int_equal
+ };
+
+ return pango_attr_int_new (&klass, spacing);
+}
+
+/**
* pango_attr_text_transform_new:
* @transform: `PangoTextTransform` to apply
*
@@ -1618,6 +1642,7 @@ pango_attribute_as_int (PangoAttribute *attr)
case PANGO_ATTR_INSERT_HYPHENS:
case PANGO_ATTR_OVERLINE:
case PANGO_ATTR_ABSOLUTE_LINE_HEIGHT:
+ case PANGO_ATTR_LINE_SPACING:
case PANGO_ATTR_TEXT_TRANSFORM:
case PANGO_ATTR_WORD:
case PANGO_ATTR_SENTENCE:
@@ -3052,6 +3077,10 @@ pango_attr_list_from_string (const char *text)
FLOAT_ATTR(line_height);
break;
+ case PANGO_ATTR_LINE_SPACING:
+ INT_ATTR(line_spacing, int);
+ break;
+
case PANGO_ATTR_ABSOLUTE_LINE_HEIGHT:
integer = g_ascii_strtoll (p, &endp, 10);
if (!is_valid_end_char (*endp)) goto fail;