After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 735336 - support text-transform property
support text-transform property
Status: RESOLVED OBSOLETE
Product: gtk+
Classification: Platform
Component: Class: GtkStyleContext
unspecified
Other Linux
: Normal enhancement
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on: 498065 751807
Blocks:
 
 
Reported: 2014-08-24 19:07 UTC by Daniel Fore
Modified: 2018-05-02 16:13 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Daniel Fore 2014-08-24 19:07:23 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
Comment 1 Robert Roth 2014-08-25 05:54:56 UTC
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
Comment 2 Matthias Clasen 2014-08-27 03:11:54 UTC
this probably needs support in pango
Comment 3 Cosimo Cecchi 2015-07-01 21:35:07 UTC
Depends on a GLib API to capitalize to title case unicode strings.
That would be the API from bug 498065.
Comment 4 Philip Chimento 2016-07-21 20:27:57 UTC
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.
Comment 5 Matthias Clasen 2016-08-02 13:06:33 UTC
this needs to be implemented in pango, when going from chars to glyphs
Comment 6 Matthias Clasen 2018-02-10 05:17:01 UTC
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.
Comment 7 Philip Chimento 2018-02-11 19:07:47 UTC
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.
Comment 8 GNOME Infrastructure Team 2018-05-02 16:13:48 UTC
-- 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.