summaryrefslogtreecommitdiff
path: root/pango/pango-attributes.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2019-08-22 11:44:25 +0200
committerMatthias Clasen <mclasen@redhat.com>2019-10-31 21:23:59 -0400
commit27ede8c45f011d5351a38019332f6f3f85c83a32 (patch)
tree05636f340e78aa75e42dc3b17187781e7fc29759 /pango/pango-attributes.c
parent85bdfead1b36945db251df22b2db6789cbf4cd6c (diff)
downloadpango-27ede8c45f011d5351a38019332f6f3f85c83a32.tar.gz
Add an overline attribute
Add a new PangoOverline enum, and overline and overline_color attributes, which parallel the attributes we have for underlines and strikethrough. For now, the enum just has 'none' and 'single' values.
Diffstat (limited to 'pango/pango-attributes.c')
-rw-r--r--pango/pango-attributes.c54
1 files changed, 54 insertions, 0 deletions
diff --git a/pango/pango-attributes.c b/pango/pango-attributes.c
index 9a80f0e1..8ff631ae 100644
--- a/pango/pango-attributes.c
+++ b/pango/pango-attributes.c
@@ -1258,6 +1258,60 @@ pango_attr_show_new (PangoShowFlags flags)
return pango_attr_int_new (&klass, (int)flags);
}
+/**
+ * pango_attr_overline_new:
+ * @overline: the overline style
+ *
+ * Create a new overline-style attribute.
+ *
+ * Return value: (transfer full): the newly allocated #PangoAttribute,
+ * which should be freed with pango_attribute_destroy().
+ *
+ * Since: 1.45
+ **/
+PangoAttribute *
+pango_attr_overline_new (PangoOverline overline)
+{
+ static const PangoAttrClass klass = {
+ PANGO_ATTR_OVERLINE,
+ pango_attr_int_copy,
+ pango_attr_int_destroy,
+ pango_attr_int_equal
+ };
+
+ return pango_attr_int_new (&klass, (int)overline);
+}
+
+/**
+ * pango_attr_overline_color_new:
+ * @red: the red value (ranging from 0 to 65535)
+ * @green: the green value
+ * @blue: the blue value
+ *
+ * Create a new overline color attribute. This attribute
+ * modifies the color of overlines. If not set, overlines
+ * will use the foreground color.
+ *
+ * Return value: (transfer full): the newly allocated #PangoAttribute,
+ * which should be freed with pango_attribute_destroy().
+ *
+ * Since: 1.45
+ **/
+PangoAttribute *
+pango_attr_overline_color_new (guint16 red,
+ guint16 green,
+ guint16 blue)
+{
+ static const PangoAttrClass klass = {
+ PANGO_ATTR_OVERLINE_COLOR,
+ pango_attr_color_copy,
+ pango_attr_color_destroy,
+ pango_attr_color_equal
+ };
+
+ return pango_attr_color_new (&klass, red, green, blue);
+}
+
/*
* Attribute List
*/