[gtk/css-line-height2: 1/5] Handle the new line height pango attribute




commit f95b9976a1ca80c5eaccba15d088e994a70cc137
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat Aug 7 12:11:29 2021 -0400

    Handle the new line height pango attribute
    
    Update all the places where we switch over
    PangoAttributeType to handle the new line
    height attribute.

 demos/gtk-demo/fontify.c | 4 ++++
 gtk/gtkpango.c           | 4 ++++
 gtk/gtktextbuffer.c      | 4 ++++
 testsuite/gtk/label.c    | 1 +
 4 files changed, 13 insertions(+)
---
diff --git a/demos/gtk-demo/fontify.c b/demos/gtk-demo/fontify.c
index 62bc34b803..562cf0ca03 100644
--- a/demos/gtk-demo/fontify.c
+++ b/demos/gtk-demo/fontify.c
@@ -255,6 +255,10 @@ insert_tags_for_attributes (GtkTextBuffer     *buffer,
           INT_ATTR (insert_hyphens);
           break;
 
+        case PANGO_ATTR_LINE_HEIGHT:
+          FLOAT_ATTR (line_height);
+          break;
+
         case PANGO_ATTR_SHAPE:
         case PANGO_ATTR_ABSOLUTE_SIZE:
         case PANGO_ATTR_GRAVITY:
diff --git a/gtk/gtkpango.c b/gtk/gtkpango.c
index 8a176b56aa..3510b38856 100644
--- a/gtk/gtkpango.c
+++ b/gtk/gtkpango.c
@@ -249,6 +249,10 @@ attribute_from_text (GtkBuilder  *builder,
                                                      color->blue * 65535);
         }
       break;
+    case PANGO_ATTR_LINE_HEIGHT:
+      if (gtk_builder_value_from_string_type (builder, G_TYPE_DOUBLE, value, &val, error))
+        attribute = pango_attr_line_height_new (g_value_get_double (&val));
+      break;
     case PANGO_ATTR_INVALID:
     default:
       break;
diff --git a/gtk/gtktextbuffer.c b/gtk/gtktextbuffer.c
index 5d550e5372..f98d4ace45 100644
--- a/gtk/gtktextbuffer.c
+++ b/gtk/gtktextbuffer.c
@@ -4689,6 +4689,10 @@ insert_tags_for_attributes (GtkTextBuffer     *buffer,
           INT_ATTR (letter_spacing);
           break;
 
+        case PANGO_ATTR_LINE_HEIGHT:
+          FLOAT_ATTR (line_height);
+          break;
+
         case PANGO_ATTR_FONT_FEATURES:
           STRING_ATTR (font_features);
           break;
diff --git a/testsuite/gtk/label.c b/testsuite/gtk/label.c
index e220432aac..3f445a3312 100644
--- a/testsuite/gtk/label.c
+++ b/testsuite/gtk/label.c
@@ -65,6 +65,7 @@ print_attribute (PangoAttribute *attr, GString *string)
       g_string_append_printf (string, "shape");
       break;
     case PANGO_ATTR_SCALE:
+    case PANGO_ATTR_LINE_HEIGHT:
       {
         char val[20];
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]