summaryrefslogtreecommitdiff
path: root/gtk/gtkcssstyle.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2017-09-18 12:42:42 -0400
committerMatthias Clasen <mclasen@redhat.com>2017-09-18 14:26:57 -0400
commitb91f3ce3312ba23041ee8844b446599bbf62f5e4 (patch)
tree32b38d1e7eb32c2627e0b7238360229303701c1d /gtk/gtkcssstyle.c
parent8a7f2ca0bef63a5b637fbf3ca1fae1df48464f02 (diff)
downloadgtk+-b91f3ce3312ba23041ee8844b446599bbf62f5e4.tar.gz
css: Implement font-variant-east-asian
This is translated to the corresponding OpenType features.
Diffstat (limited to 'gtk/gtkcssstyle.c')
-rw-r--r--gtk/gtkcssstyle.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/gtk/gtkcssstyle.c b/gtk/gtkcssstyle.c
index 1fbe5e6bba..f6eaa35764 100644
--- a/gtk/gtkcssstyle.c
+++ b/gtk/gtkcssstyle.c
@@ -231,6 +231,7 @@ gtk_css_style_get_pango_attributes (GtkCssStyle *style)
GtkCssValue *caps;
GtkCssValue *numeric;
GtkCssValue *alternatives;
+ GtkCssValue *east_asian;
GString *s;
int i;
@@ -379,6 +380,31 @@ gtk_css_style_get_pango_attributes (GtkCssStyle *style)
g_string_append (s, "hist 1");
}
+ east_asian = gtk_css_style_get_value (style, GTK_CSS_PROPERTY_FONT_VARIANT_EAST_ASIAN);
+ for (i = 0; i < _gtk_css_array_value_get_n_values (east_asian); i++)
+ {
+ GtkCssValue *value = _gtk_css_array_value_get_nth (east_asian, i);
+ if (s->len > 0) g_string_append (s, ", ");
+ if (strcmp (_gtk_css_ident_value_get (value), "jis78") == 0)
+ g_string_append (s, "jp78 1");
+ if (strcmp (_gtk_css_ident_value_get (value), "jis83") == 0)
+ g_string_append (s, "jp83 1");
+ if (strcmp (_gtk_css_ident_value_get (value), "jis90") == 0)
+ g_string_append (s, "jp90 1");
+ if (strcmp (_gtk_css_ident_value_get (value), "jis04") == 0)
+ g_string_append (s, "jp04 1");
+ if (strcmp (_gtk_css_ident_value_get (value), "simplified") == 0)
+ g_string_append (s, "smpl 1");
+ if (strcmp (_gtk_css_ident_value_get (value), "traditional") == 0)
+ g_string_append (s, "trad 1");
+ if (strcmp (_gtk_css_ident_value_get (value), "full-width") == 0)
+ g_string_append (s, "fwid 1");
+ if (strcmp (_gtk_css_ident_value_get (value), "proportional-width") == 0)
+ g_string_append (s, "pwid 1");
+ if (strcmp (_gtk_css_ident_value_get (value), "ruby") == 0)
+ g_string_append (s, "ruby 1");
+ }
+
attrs = add_pango_attr (attrs, pango_attr_font_features_new (s->str));
g_string_free (s, TRUE);