GNOME Bugzilla – Bug 725506
Replace the custom/in-house font chooser UI by the use of GTK's new FontButton / FontChooserDialog
Last modified: 2014-03-12 15:30:12 UTC
GTK's font chooser, since version 3.6 or 3.8 or so, is actually wonderful to use. It has a built-in search and it looks great. I suspect Gnumeric's hierarchical alphabetic menu system for choosing fonts is from a time where GTK sucked in that regard. Time to rip it out and simply use https://developer.gnome.org/gtk3/stable/GtkFontButton.html (which will call out to https://developer.gnome.org/gtk3/stable/GtkFontChooserDialog.html unless you want to use that directly) This should free you from the burden of maintaining that code and should be more consistent with the rest of GNOME/GTK apps. Thanks!
I looked at that dialog before making my own. My head is still shaking with a "what were they thinking?" Gtk's font dialog is absolutely hopeless! It is, in fact, time to take it out back and shoot it. And then perhaps put goffice's new dialog in its place. Here's what is wrong: with a large number of fonts on the system there is really only one way of finding a font: typing its name. Scrolling is not practical. If I want that behaviour I can just use a GtkEntry. And gtk's font dialog treats all fonts the same. Some silly dingbat font is given equal standing to "Sans". Goffice's puts priority on some fonts. The only upside of Gtk's dialog is the instant preview. In practical terms that's not terribly important for a spreadsheet user. It's as-if Gtk's designers forgot to ask the simple question of what users want to do when they push the font button.
> Gtk's font dialog is absolutely hopeless! It is, in fact, time to take it > out back and shoot it. And then perhaps put goffice's new dialog in its > place. Such strong words coming from a maintainer of respectable project like that, I'm a bit taken by surprise, to be honest. > Here's what is wrong: with a large number of fonts on the system there is > really only one way of finding a font: typing its name. Scrolling is not > practical. If I want that behaviour I can just use a GtkEntry. Of course, any font picker is going to depend on the name whenever there is a large amount of fonts to choose from. Goffice's alpha-hierarchical menu-based font picking system is no different in that regard, except that I have to use the mouse and spend 2-3 seconds to find the font I'm looking for instead of 0.25 seconds (because I can type "source" or "droid" in 0.25 seconds). > And gtk's font dialog treats all fonts the same. Some silly dingbat font > is given equal standing to "Sans". Goffice's puts priority on some fonts. Ah, I see where the core grief you have is... you want to have presets (Sans, Serif and Monospace). But to play the devil's advocate, those presets are, as you will agree, arbitrary. What if a user's top 3 favorite fonts are Linux Libertine, Droid Sans and Inconsolata? (Sans, Serif and Monospace sure are not the default fonts on the systems I maintain, for instance) Then those presets are not any more helpful than the rest. And arguably, if the user bothers to summon the font picker, it's because they want to choose a *custom font*, otherwise they would typically just leave the font to the spreadsheet/cell's default. Whatsmore, beyond showing three arbitrary fonts more proeminently than the rest, your system does not actually filter out the "bad fonts" (besides, whose responsibility/right is it to "blacklist" fonts anyway?). The terrible "dingbat" font you speak of in your example does show up in Goffice/Gnumeric's font picker, except it's much worse because it pollutes the list of hierarchical fonts in your menu system and increases the amount of trial-and-error for users. I am not convinced by the argument you put forth that the standard GTK font chooser is any worse than Goffice's in that regard, quite the contrary. And your need for presets can be fulfilled quite easily without needing to roll your own font picker that will carry its own set of issues. > The only upside of Gtk's dialog is the instant preview. In practical terms > that's not terribly important for a spreadsheet user. GTK's dialog has many more advantages than what you depict. 1- It saves me a crapton of error-prone mouse movements (it's incredibly easy to "miss" a submenu) and mouse clicks. 2- It allows me to find the font I'm looking for *instantly* by searching. I'm *much* faster with a filtering interface than with an alphabetical menu interface. 3- It actually makes good use of my screen's space. Why, on a 1920x1080 screen, would I want to deal with a narrow set of menus on a 420x240 px dialog? Whatsmore, GTK's font chooser remembers its size, so if I decide that I'd like it to take the full height of my screen to help me pick fonts more easily, I can do so. 4- It allows me to browse and forego trial-and-error completely, as I have a preview of all the fonts and can thus ignore the dingbat-style fonts. 5- It gives me more choice. Your current font chooser eliminates all the font variants. For example, I cannot choose "Source Sans Pro ExtraLight" nor "Linux Libertine O Semi-Bold". I can guarantee you that those font variants are not the same thing as just picking the normal/main variant and applying bold on top of it. 6- It allows me to preview a custom text that I care about instead of foxes jumping over lazy dogs :) 7- It allows me to search by categories and weight types. I can search for "sans" and not only get the "Sans" font, but also all the other sans-serif fonts like Droid Sans, Source Sans Pro, etc., allowing me to easily make a comparison between those options. I can search for "light" to get all fonts with a specific variant of that type, including not only Source Sans's "Light", "Ultra-Light" variants, but also "URW Bookman L" (notice how "Light" is not even in its name). It allows me to search for "sans bold" to combine both searching for the type/name and the weight. Your approach forbids all that choice and flexibility. 8- It is not incompatible with your desire to have presets/suggestions. See below: I have a solution that is a win-win situation for everybody. You want a preset system, and I (along with many users, I suspect) would love to GTK's nice filterable + previewable + keyboard-intensive system. Why not simply add your three font presets on top of GTK's FontChooserWidget into a GtkDialog and be done with it? Attaching a glade file that does exactly that, if you're curious. I see absolutely no drawback with that compared to the current approach, it's the best of both worlds and you also get simpler/cleaner code. > It's as-if Gtk's designers forgot to ask the simple question of what users > want to do when they push the font button. I am a gnumeric user. I am one of those people you speak of. Have you actually asked your users about this or are you projecting your own habits as a developer and "assuming" what users need is a hierarchical menu? Give my family members (or my friends) the choice between gnumeric's font picker and the new GTK3 font chooser and they will choose GTK's any time of the day. They either *don't know* which font exactly they want to use (and want to try/compare things), or they *do* know which font they want to use, then they'd love to just type it up instead of wading through menus. Personally, I've always been unsatisfied with the previous approaches (be it in the old GTK or in other app on earth that decides to invent its own custom approach) and the new GTK font chooser made me jump with joy at its increased ease of use and efficiency. It's alright to have been unsettled by what seems like a fundamental change, but it seems to me like you may have thrown the baby with the bathwater and missed many interesting benefits of the new implementation. And as I demonstrated, there is nothing preventing you from adding your three presets atop GTK's font chooser widget. Please consider it. Thanks!
Created attachment 270718 [details] screenshot
Created attachment 270721 [details] demo gtkbuilder file
I completely agree with Morten on this count.
Hi Andreas, as far as I understand it, Morten's argument against using the standard chooser is: 1- "With a large number of fonts, you can only find a font by its name": The goffice implementation has the same problem. 2- "Scrolling is not practical": Well, scrolling is not necessary when you've filtered results! On the contrary, I consider navigating nested menus to be much more impractical; I keep going offtarget. I could count this as +1 for the standard font chooser widget, but I'll consider this a "draw" in good faith. 3- "Goffice's puts priority on some fonts": My proposed approach allows this too. Draw. 4- "gtk treats all fonts the same, dingbats has equal standing to 'Sans'" (except point #3 above), in the sense that it doesn't "hide" bad fonts: The goffice implementation has the same problem. After all this, the score is a draw/tie. Then, if you count the 8 examples of advantages the standard chooser has over the homebrew UI, the score should logically end up in favor of the standard UI + "preset buttons". As far as I can tell with the information available to me here, the goffice implementation has multiple problems while the standard chooser widget has only one drawback that can be solved by adding three "presets" buttons above it. Or is there another core issue you encountered that you forgot to mention? Please help me understand! I don't know why you would still be against this approach after I've taken the time to research this, found a way to solve issue #3 and presented the many advantages of the new standard font chooser. It makes life easier for users and for maintainers. What's not to love? I'm puzzled.
Can you give any substantial piece of software that uses the GtkFontChooserDialog? If not than adopting it would mean debugging another piece of Gtk software (and creating workarounds for the bugs). Chances are slim that anybody here would be willing to commit to that. On top of that the GtkFontChooserDialog is horrendous. I can really not imagine somebody needing to see '...fox..." rendered in every font available on a system.
> Such strong words Well, you started. "Time to rip it out and simply use https://developer.gnome.org/gtk3/stable/GtkFontButton.html". We are not limited to bold/italic. I have no trouble selecting "CMU Sans Serif Semi Condensed". The sample text used is configurable using the font-chooser interface's preview text attribute. We have strike-through selection. We have font colour selection. We have underline selection. We have superscript and subscript. The presets are hardcoded for now. They should be configurable and there should be a submenu for fonts already used in the document. It's somewhere on my list. We show something useful when the dialog comes up. Gtk's shows a bunch of nonsense fonts and I have to scroll down 2-3 pages before anything remotely useful shows up. Screenshot coming up. We also deal with the real world. Search for "samll" in your chooser and try to explain the three fonts you see. Screenshot coming up. > 1- "With a large number of fonts, you can only find a font by its name": > The goffice implementation has the same problem. It's a matter of scale. Gtk's breaks down at around 100 fonts. Goffice's handles 2000 fonts. But yes, at 1000000 fonts neither would be useful. Also, that's a misquote: what I wrote about Gtk's font chooser is "with a large number of fonts on the system there is really only one way of finding a font: typing its name". Note the word "typing". Goffice's does not require typing and the extra time consuming keyboard-to-mouse switches that go with it.
Created attachment 270802 [details] Font chooser This is how Gtk's font chooser comes up in my gedit when I select Edit->Preferences->Font->... This is the first impression the font chooser makes on users! It's just a bunch of unreadable hieroglyphs with meaningless text (font names as it were) attached.
Created attachment 270804 [details] Search for "samll" Font names in the real world weren't meant for searching. It's a mess of inconsistent naming and spelling with no obvious way of getting that fixed.
Hi, I meant to reply to this sooner but was kept busy. > Can you give any substantial piece of software that uses the > GtkFontChooserDialog? Well, at least those projects use it: Evolution, Gedit, GNOME Terminal, Pitivi, Devhelp, Epiphany, GNOME Tweak Tool, Meld (version 3.11+). The apps I've seen use their own custom font picker are LibreOffice (not GTK), GIMP and Inkscape (and Inkscape is terribly buggy/cumbersome) >> Such strong words > Well, you started. "Time to rip it out and simply use..." Apologies if that offended you, that was REALLY not intended as such. It would have been more accurate of my view if I wrote it as "Time to retire it in favor of...". The line right above said "I suspect Gnumeric's hierarchical alphabetic menu system for choosing fonts is from a time where GTK sucked in that regard". Notice that I used the word "suspect", because I honestly thought it was just an old implementation that had not been ported yet. Also, notice that I never called your own implementation "absolutely hopeless" and needing to be "[taken] out back and shot". I only assumed it was from a time where there were no good alternatives, and praised the new standard GTK3 font chooser as an alternative. But anyway, that's just linguistics. Moving on. > I have no trouble selecting "CMU Sans Serif Semi Condensed". I was about to say "huh? I can't do that on my end" and cite the example of gnumeric offering only DejaVu Sans, Serif and Monospace... I couldn't select DejaVu Sans Condensed nor DejaVu Sans Light. Then I found out that you expose different parts of your font chooser in different parts of gnumeric - I was looking at the contents of the dialog when you click the font button on the formatting toolbar in the main window! > It's a matter of scale. Gtk's breaks down at around 100 fonts. Goffice's > handles 2000 fonts. ...wow. I had no idea you had that many fonts installed. Anyway, I see your point and there is no reason for me to argue further. If the elements I presented in my previous comments could not convince you, I suspect nothing will. Too bad!