GNOME Bugzilla – Bug 735336
support text-transform property
Last modified: 2018-05-02 16:13:48 UTC
What I think would be super helpful and give developers less of a chance to do something wrong is to support the text-transform property in GtkCSSProvider. But more specifically, I'd mostly like to be able to enforce "capitalize". In this way, we can enforce that buttons, menu items, titles, headers, etc are always Title Case. (I'm not sure if Title Case is slightly different from the web interpretation of "capitalize" since Title Case doesn't capitalize prepositions like "of" and "to") http://www.w3schools.com/cssref/pr_text_text-transform.asp
Some comments: * this doesn't seem to affect GtkLabel only, but GtkCssProvider, so GtkStyleContext seems to be more appropriate as the component, I have set it accordingly * if implemented, this should be implemented by having the required string utility functions implemented in GLib (something like bug 498065). Looking at the w3c page, it seems that the only missing function is capitalize, as we already have uppercase[1][2] and tolowercase[3][4] implemented in glib * according to the w3c wiki[5] text-transform capitalize does convert the first letter of each word, including "of", "to", "is", "a", so that's not exactly titlecasing, so I suggest adding an additional option, "titlecase". [1] https://developer.gnome.org/glib/unstable/glib-String-Utility-Functions.html#g-ascii-strup [2] https://developer.gnome.org/glib/unstable/glib-Unicode-Manipulation.html#g-utf8-strup [3] https://developer.gnome.org/glib/unstable/glib-String-Utility-Functions.html#g-ascii-strdown [4] https://developer.gnome.org/glib/unstable/glib-Unicode-Manipulation.html#g-utf8-strdown [5] http://www.w3.org/wiki/CSS/Properties/text-transform
this probably needs support in pango
Depends on a GLib API to capitalize to title case unicode strings. That would be the API from bug 498065.
I asked Allison about this briefly at the GTK hackfest. She was not a fan of adding it as GLib API because (correct me if I'm misremembering or misparaphrasing, since I forgot to write notes at the time) "title case" is not well-defined (Unicode, CSS spec, ...) and so the title case would be better off private to the GtkLabel implementation, rather than GLib taking a position on which implementation is the "correct" one.
this needs to be implemented in pango, when going from chars to glyphs
We're moving to gitlab! As part of this move, we are moving bugs to NEEDINFO if they haven't seen activity in more than a year. If this issue is still important to you and still relevant with GTK+ 3.22 or master, please reopen it and we will migrate it to gitlab.
This is still important to me. I'll continue to advocate at Endless for sponsoring development on it, we'll need it when we port our stuff to GTK4 and can't use our current workaround of a style property.
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gtk/issues/505.