summaryrefslogtreecommitdiff
path: root/pango/pango-attributes.h
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2021-08-07 10:37:07 -0400
committerMatthias Clasen <mclasen@redhat.com>2021-08-08 21:35:55 -0400
commit623134f48ad998e1392839f7346c780228ddac45 (patch)
tree606d44e9f51b5a692b69e183999253e96080f06c /pango/pango-attributes.h
parented13e662d1a327671fc9f1a3ec7d71c4bbfe1280 (diff)
downloadpango-623134f48ad998e1392839f7346c780228ddac45.tar.gz
Add line-height attributes
Add attributes for line-height, in a relative and absolute variant. This will be used to grow the logical extents of runs in a way that is compatible with CSS semantics. In markup, we support a new line_height attribute that will be interpreted as absolute if it is an integer > 1024, and as a relative factor otherwise.
Diffstat (limited to 'pango/pango-attributes.h')
-rw-r--r--pango/pango-attributes.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/pango/pango-attributes.h b/pango/pango-attributes.h
index 6f18718e..c28623fb 100644
--- a/pango/pango-attributes.h
+++ b/pango/pango-attributes.h
@@ -160,6 +160,7 @@ typedef struct _PangoAttrIterator PangoAttrIterator;
* @PANGO_ATTR_INSERT_HYPHENS: whether to insert hyphens at intra-word line breaks ([struct@Pango.AttrInt]). Since 1.44
* @PANGO_ATTR_OVERLINE: whether the text has an overline ([struct@Pango.AttrInt]). Since 1.46
* @PANGO_ATTR_OVERLINE_COLOR: overline color ([struct@Pango.AttrColor]). Since 1.46
+ * @PANGO_ATTR_LINE_HEIGHT: line height factor ([struct@Pango.AttrFloat]). Since: 1.50
*
* The `PangoAttrType` distinguishes between different types of attributes.
*
@@ -201,6 +202,8 @@ typedef enum
PANGO_ATTR_INSERT_HYPHENS, /* PangoAttrInt */
PANGO_ATTR_OVERLINE, /* PangoAttrInt */
PANGO_ATTR_OVERLINE_COLOR, /* PangoAttrColor */
+ PANGO_ATTR_LINE_HEIGHT, /* PangoAttrFloat */
+ PANGO_ATTR_ABSOLUTE_LINE_HEIGHT, /* PangoAttrInt */
} PangoAttrType;
/**
@@ -611,6 +614,11 @@ typedef enum {
PANGO_AVAILABLE_IN_1_44
PangoAttribute *pango_attr_show_new (PangoShowFlags flags);
+PANGO_AVAILABLE_IN_1_50
+PangoAttribute *pango_attr_line_height_new (double factor);
+PANGO_AVAILABLE_IN_1_50
+PangoAttribute *pango_attr_line_height_new_absolute (int height);
+
PANGO_AVAILABLE_IN_ALL
GType pango_attr_list_get_type (void) G_GNUC_CONST;
PANGO_AVAILABLE_IN_ALL