mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-13 05:50:10 +00:00
Handle the new line height pango attribute
Update all the places where we switch over PangoAttributeType to handle (and ignore, for now) the new line height attribute.
This commit is contained in:
parent
04f3c8054b
commit
528ebfabf0
@ -255,6 +255,12 @@ insert_tags_for_attributes (GtkTextBuffer *buffer,
|
||||
INT_ATTR (insert_hyphens);
|
||||
break;
|
||||
|
||||
#if PANGO_VERSION_CHECK(1,49,0)
|
||||
case PANGO_ATTR_LINE_HEIGHT:
|
||||
case PANGO_ATTR_ABSOLUTE_LINE_HEIGHT:
|
||||
break;
|
||||
#endif
|
||||
|
||||
case PANGO_ATTR_SHAPE:
|
||||
case PANGO_ATTR_ABSOLUTE_SIZE:
|
||||
case PANGO_ATTR_GRAVITY:
|
||||
|
@ -249,6 +249,16 @@ attribute_from_text (GtkBuilder *builder,
|
||||
color->blue * 65535);
|
||||
}
|
||||
break;
|
||||
#if PANGO_VERSION_CHECK(1, 49, 0)
|
||||
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_ABSOLUTE_LINE_HEIGHT:
|
||||
if (gtk_builder_value_from_string_type (builder, G_TYPE_INT, value, &val, error))
|
||||
attribute = pango_attr_line_height_new_absolute (g_value_get_int (&val) * PANGO_SCALE);
|
||||
break;
|
||||
#endif
|
||||
case PANGO_ATTR_INVALID:
|
||||
default:
|
||||
break;
|
||||
|
@ -4689,6 +4689,12 @@ insert_tags_for_attributes (GtkTextBuffer *buffer,
|
||||
INT_ATTR (letter_spacing);
|
||||
break;
|
||||
|
||||
#if PANGO_VERSION_CHECK(1, 49, 0)
|
||||
case PANGO_ATTR_LINE_HEIGHT:
|
||||
case PANGO_ATTR_ABSOLUTE_LINE_HEIGHT:
|
||||
break;
|
||||
#endif
|
||||
|
||||
case PANGO_ATTR_FONT_FEATURES:
|
||||
STRING_ATTR (font_features);
|
||||
break;
|
||||
|
@ -41,6 +41,9 @@ print_attribute (PangoAttribute *attr, GString *string)
|
||||
case PANGO_ATTR_ALLOW_BREAKS:
|
||||
case PANGO_ATTR_INSERT_HYPHENS:
|
||||
case PANGO_ATTR_SHOW:
|
||||
#if PANGO_VERSION_CHECK(1, 49, 0)
|
||||
case PANGO_ATTR_ABSOLUTE_LINE_HEIGHT:
|
||||
#endif
|
||||
g_string_append_printf (string, "%d", ((PangoAttrInt *)attr)->value);
|
||||
break;
|
||||
case PANGO_ATTR_FONT_DESC:
|
||||
@ -65,6 +68,9 @@ print_attribute (PangoAttribute *attr, GString *string)
|
||||
g_string_append_printf (string, "shape");
|
||||
break;
|
||||
case PANGO_ATTR_SCALE:
|
||||
#if PANGO_VERSION_CHECK(1, 49, 0)
|
||||
case PANGO_ATTR_LINE_HEIGHT:
|
||||
#endif
|
||||
{
|
||||
char val[20];
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user