Don't forget to serialize overlines

This commit is contained in:
Matthias Clasen 2024-02-02 16:15:38 +01:00
parent 6e0596e122
commit 5453628491
2 changed files with 22 additions and 0 deletions

View File

@ -472,6 +472,20 @@ pango_underline_to_string (PangoUnderline value)
}
}
const char *
pango_overline_to_string (PangoOverline value)
{
switch (value)
{
case PANGO_OVERLINE_NONE:
return "none";
case PANGO_OVERLINE_SINGLE:
return "single";
default:
g_assert_not_reached ();
}
}
const char *
pango_wrap_mode_to_string (PangoWrapMode mode)
{
@ -785,6 +799,13 @@ gtk_pango_get_run_attributes (PangoLayout *layout,
g_ptr_array_add (values, g_strdup (pango_underline_to_string (pango_int->value)));
}
pango_int = (PangoAttrInt *) pango_attr_iterator_get (iter, PANGO_ATTR_OVERLINE);
if (pango_int != NULL)
{
g_ptr_array_add (names, g_strdup ("overline"));
g_ptr_array_add (values, g_strdup (pango_overline_to_string (pango_int->value)));
}
pango_int = (PangoAttrInt *) pango_attr_iterator_get (iter, PANGO_ATTR_STRIKETHROUGH);
if (pango_int != NULL)
{

View File

@ -57,6 +57,7 @@ gtk_pango_attribute_start_element (GtkBuildableParseContext *context,
const char *pango_wrap_mode_to_string (PangoWrapMode mode);
const char *pango_underline_to_string (PangoUnderline underline);
const char *pango_overline_to_string (PangoOverline underline);
const char *pango_stretch_to_string (PangoStretch stretch);
const char *pango_style_to_string (PangoStyle style);
const char *pango_variant_to_string (PangoVariant variant);