Re: patch: go-combo-font



Le jeudi 09 juin 2005 à 20:03 +0200, Robert Staudinger a écrit :
Hi, 

This is the, well, "patch" to goffice that adds a font combobox (as
prototyped in AbiWord).
What does it do:
+ On first startup it shows a combobox containing all system font
families (showed in standard application font)
+ Using a timeout every second a font is "thumbnailed". The
corresponding entry in the combo is rendered in its own font face
using the thumbnail.
+ When all fonts are thumbnailed a cache file containing the
thumbnails is written to .goffice.
+ Subsequent launches load the thumbnails from the cache file directly
and don't have to touch the fonts at all.
+ If the system font size is changed new thumbnails are generated at
next startup, same if new fonts are installed on the system.

While not totally ready i'd like to get your feedback on this because
its "structually complete" and does what it should.
Unfortunately the crappy gnome anoncvs doesn't let me diff today so i
hope it is ok to send the tarball with the files. They go in
goffice/gtk.

Outstanding polish: 
+ Create a cell renderer that draws the text in theme color (currently
black). Thumbnails have alpha channel, so background adapts to theme
already.
+ Hook "style-changed" and redo thumbnails if fontsize has changed.

I've just tested your code. 

I really think a combo box is not the right widget for selecting a font,
because you probably have more fonts on your system that your screen can
display. And navigating trough combo entries when drop down box doesn't
fit on screen is terrible.

Also, for font like windings or symbols, you don't display something
readable. If you can't know if a given font produces something readable,
an alternative could be to display font name using standard font
followed by a test string with the given font (No need of a long test
string, may be AaBb is enough).

Regarding thumbnail generation, what happens if combo box is not
displayed long enough and then not let the widget generates all
thumbnails ?

        Emmanuel.




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