diff options
author | Owen Taylor <otaylor@redhat.com> | 2004-11-23 15:42:44 +0000 |
---|---|---|
committer | Owen Taylor <otaylor@src.gnome.org> | 2004-11-23 15:42:44 +0000 |
commit | db50679d56c8ded8a23f239b24a8cd9f1f2061c2 (patch) | |
tree | 8c7bc025eff030673c83214ecd410bf092ff3ceb /pango/pango-markup.c | |
parent | a0bbc6ef8b7dc902f20a2655cc54082e6acdca84 (diff) | |
download | pango-db50679d56c8ded8a23f239b24a8cd9f1f2061c2.tar.gz |
Add underline_color and strikethrough_color attribute types. (#147616,
Tue Nov 23 10:23:43 2004 Owen Taylor <otaylor@redhat.com>
* pango/pango-attributes.[ch]: Add underline_color
and strikethrough_color attribute types. (#147616, Morten
Welinder)
* pango/pango-markup.c docs/pango_markup.sgml: Add
corresponding 'underline_color' and
'strikethrough_color' attributes for <span>.
* pango/pango-renderer.c (pango_renderer_default_prepare_run):
Implement underline and strikethrough colors.
* pango/pango-renderer.c: Fix some bigs with updating
underlines/strikethrough state.
* pango/pango-renderer.c (get_total_matrix): Fix a const
warning.
* docs/pango-sections.txt: Update
Diffstat (limited to 'pango/pango-markup.c')
-rw-r--r-- | pango/pango-markup.c | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/pango/pango-markup.c b/pango/pango-markup.c index 3b45cc73..5f68b8cd 100644 --- a/pango/pango-markup.c +++ b/pango/pango-markup.c @@ -855,7 +855,9 @@ span_parse_func (MarkupData *md, const char *foreground = NULL; const char *background = NULL; const char *underline = NULL; + const char *underline_color = NULL; const char *strikethrough = NULL; + const char *strikethrough_color = NULL; const char *rise = NULL; const char *letter_spacing = NULL; const char *lang = NULL; @@ -919,11 +921,21 @@ span_parse_func (MarkupData *md, CHECK_DUPLICATE (underline); underline = values[i]; } + else if (strcmp (names[i], "underline_color") == 0) + { + CHECK_DUPLICATE (underline_color); + underline_color = values[i]; + } else if (strcmp (names[i], "strikethrough") == 0) { CHECK_DUPLICATE (strikethrough); strikethrough = values[i]; } + else if (strcmp (names[i], "strikethrough_color") == 0) + { + CHECK_DUPLICATE (strikethrough_color); + strikethrough_color = values[i]; + } else if (strcmp (names[i], "rise") == 0) { CHECK_DUPLICATE (rise); @@ -1177,6 +1189,24 @@ span_parse_func (MarkupData *md, add_attribute (tag, pango_attr_underline_new (ul)); } + if (underline_color) + { + PangoColor color; + + if (!pango_color_parse (&color, underline_color)) + { + g_set_error (error, + G_MARKUP_ERROR, + G_MARKUP_ERROR_INVALID_CONTENT, + _("Could not parse underline_color color specification " + "'%s' on line %d"), + underline_color, line_number); + goto error; + } + + add_attribute (tag, pango_attr_underline_color_new (color.red, color.green, color.blue)); + } + if (strikethrough) { if (strcmp (strikethrough, "true") == 0) @@ -1196,6 +1226,24 @@ span_parse_func (MarkupData *md, } } + if (strikethrough_color) + { + PangoColor color; + + if (!pango_color_parse (&color, strikethrough_color)) + { + g_set_error (error, + G_MARKUP_ERROR, + G_MARKUP_ERROR_INVALID_CONTENT, + _("Could not parse strikethrough_color color specification " + "'%s' on line %d"), + strikethrough_color, line_number); + goto error; + } + + add_attribute (tag, pango_attr_strikethrough_color_new (color.red, color.green, color.blue)); + } + if (fallback) { if (strcmp (fallback, "true") == 0) |