diff options
author | Matthias Clasen <mclasen@redhat.com> | 2017-09-18 10:01:05 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2017-09-18 14:26:57 -0400 |
commit | 8a7f2ca0bef63a5b637fbf3ca1fae1df48464f02 (patch) | |
tree | f1d386029ed9d5813f77db927ccc9398faadac77 /gtk/gtkcssstyle.c | |
parent | b99cb70299e9a5148556540dc584ea5535241a6e (diff) | |
download | gtk+-8a7f2ca0bef63a5b637fbf3ca1fae1df48464f02.tar.gz |
css: Implement font-variant-alternatives
This is only a partial implementation, since we don't support
@font-feature-values. The only supported value is historical-forms,
for now.
Diffstat (limited to 'gtk/gtkcssstyle.c')
-rw-r--r-- | gtk/gtkcssstyle.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/gtk/gtkcssstyle.c b/gtk/gtkcssstyle.c index 33960349d8..1fbe5e6bba 100644 --- a/gtk/gtkcssstyle.c +++ b/gtk/gtkcssstyle.c @@ -230,6 +230,7 @@ gtk_css_style_get_pango_attributes (GtkCssStyle *style) GtkCssValue *position; GtkCssValue *caps; GtkCssValue *numeric; + GtkCssValue *alternatives; GString *s; int i; @@ -369,6 +370,15 @@ gtk_css_style_get_pango_attributes (GtkCssStyle *style) g_string_append (s, "zero 1"); } + alternatives = gtk_css_style_get_value (style, GTK_CSS_PROPERTY_FONT_VARIANT_ALTERNATIVES); + for (i = 0; i < _gtk_css_array_value_get_n_values (alternatives); i++) + { + GtkCssValue *value = _gtk_css_array_value_get_nth (alternatives, i); + if (s->len > 0) g_string_append (s, ", "); + if (strcmp (_gtk_css_ident_value_get (value), "historical-forms") == 0) + g_string_append (s, "hist 1"); + } + attrs = add_pango_attr (attrs, pango_attr_font_features_new (s->str)); g_string_free (s, TRUE); |