Re: GtkFontSelection

"Damon Chaplin" <> writes:

> Hi,
> I've uploaded a GtkFontSelection widget to
> (at least I think I have).

(Moved to /pub/gtk/patches/gtk-chaplin-980522-0.patch.tgz)
> I hope there's no trouble with it.

Trouble, no. Comments, yes ;-)

General comment:

 - When creating new widgets, if they work with unpatched
   GTK, then it is better to distribute them as a tarball with
   a Makefile that can be compiled separate from GTK. 

   (It was easy enough to change gtkfontsel to do this, but
   it is nicer if it does it out of the box)

   Integrating such a widget into GTK+ is a few minutes work,
   and only has to be done once. Before it is integrated
   lots of people may want to look at it, and they shouldn't
   have to patch and recompile GTK.

User interface:

 - The system of combining the width/slant/weight into a 
   single textual description is pretty nifty for browsing.
   However, it makes some tasks like "Find a nice looking
   italic font", which are easy with XLFD's or with the 
   GIMP/GNOME font selector quite difficult. 

   Perhaps there could a be another tab "Filter", with option
   menus like in the GIMP/GNOME fontsel. When a filter was
   set there, only the fonts with a style matching the filter
   would be displayed on the main tab.

   You'd want a "Clear Filter" button, disabled unless a
   (non-empty) filter is in effect, to remind the user why
   they are only seeing a few fonts.

 - The CLists work well for the Font and style. But they
   are a real nuisance for size. A size should be selectable
   in a single click without having to scroll around a little
   list, and then click on a size.

   I'd suggest using a Combo. (Especially in its improved
   1.1 form)

 - (A problem that is shared with the GIMP and GNOME filesels)
   The interface should avoid scaling bitmap fonts unless
   the user selects a "scale bitmap fonts" checkbox. Scaled
   bitmap fonts are pretty much never desirable.
   (It is especially important not to do this when 16-bit fonts
   are present, since scaling a font with thousands of characters
   locks up the server for several seconds - this is very
   easy to trigger when these fonts are listed along with everything

   Determining what is a bitmap font and what isn't is a bit
   hard, because recent X font servers will list an XLFD
   with a point size of 0 for bitmap fonts, since they know
   how to scale bitmaps.
   On my system, a heuristic that could be used is that 
   true scalable fonts report x and y resolutions of 0,
   while scaled bitmaps use the bitmaps x and y resolutions.
   Somebody with xfstt installed might want to check if
   that also works with how it reports TrueType fonts.

   When the user selects a bitmap font, the only sizes listed
   in the combobox should be the sizes that the server
   reports for that size. If the user enters a different size 
   in the combobox, the closest available size should be used, 
   unless the user has checked "scale bitmap fonts" (You
   probably want another label or non-editable entry to display the 
   actual size being used).


 - The behavior of the preview space where it always grows
   as you pick larger fonts, and never shrinks is a bit
   odd. Perhaps the dialog should have an auto_shrink policy.

 - The testgtk example font selectors need to go away on
   OK and Cancel. ;-)


 - There should be functions for the application to get and
   set the sample text. This is necessary for an application
   like the gimp that wants to use the font selector for
   combined font and string entry.

That's all for now. It's a quite nicely done widget, and I
think definitely belongs in GTK+, especially if the above
points can be addressed.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]