diff options
author | Behdad Esfahbod <behdad@behdad.org> | 2015-06-18 11:49:40 -0700 |
---|---|---|
committer | Behdad Esfahbod <behdad@behdad.org> | 2015-06-18 11:49:40 -0700 |
commit | ba53f29f7c2c105becb898d6417a4c160b7fc1e5 (patch) | |
tree | 3bf0d589b0d549192fbbe0dc321fcd4235c416d6 /pango/pango-markup.c | |
parent | dfe7ec760e08485520668ed1e2585c85545fc013 (diff) | |
download | pango-ba53f29f7c2c105becb898d6417a4c160b7fc1e5.tar.gz |
Bug 738505 - Add fontfeatures support in PangoAttributes and markup
https://bugzilla.gnome.org/show_bug.cgi?id=738505
Patch from Matthias Clasen, based on early patch from Akira TAGOH.
There's room for improvement in how this is done, but it works now
for simple cases, which is what most people will be using it for.
Finally!
Diffstat (limited to 'pango/pango-markup.c')
-rw-r--r-- | pango/pango-markup.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/pango/pango-markup.c b/pango/pango-markup.c index c96c29e9..aedf96f9 100644 --- a/pango/pango-markup.c +++ b/pango/pango-markup.c @@ -1077,6 +1077,7 @@ span_parse_func (MarkupData *md G_GNUC_UNUSED, const char *fallback = NULL; const char *gravity = NULL; const char *gravity_hint = NULL; + const char *font_features = NULL; g_markup_parse_context_get_position (context, &line_number, &char_number); @@ -1119,7 +1120,9 @@ span_parse_func (MarkupData *md G_GNUC_UNUSED, CHECK_ATTRIBUTE2(weight, "font_weight"); CHECK_ATTRIBUTE (foreground); - CHECK_ATTRIBUTE2 (foreground, "fgcolor"); + CHECK_ATTRIBUTE2(foreground, "fgcolor"); + + CHECK_ATTRIBUTE (font_features); break; case 's': CHECK_ATTRIBUTE (size); @@ -1142,7 +1145,7 @@ span_parse_func (MarkupData *md G_GNUC_UNUSED, break; default: CHECK_ATTRIBUTE (background); - CHECK_ATTRIBUTE2 (background, "bgcolor"); + CHECK_ATTRIBUTE2(background, "bgcolor"); CHECK_ATTRIBUTE2(foreground, "color"); CHECK_ATTRIBUTE (rise); CHECK_ATTRIBUTE (variant); @@ -1431,6 +1434,11 @@ span_parse_func (MarkupData *md G_GNUC_UNUSED, pango_attr_language_new (pango_language_from_string (lang))); } + if (G_UNLIKELY (font_features)) + { + add_attribute (tag, pango_attr_font_features_new (font_features)); + } + return TRUE; error: |