
The usability of the font family drop-down list in the Text tool controls bar has been improved: it no longer steals focus, all keyboard shortcuts work as designed (Alt+X to access the family control, Alt+down to open the drop-down list, arrows to move in the list, Enter to set chosen font) and the completion feature works (start typing a family name and a pop-up list with possible completions appears). Remaining problems that may be fixed in the future versions:
* The first opening of the drop-down list of family names may be slow if you have many fonts installed (the delay is Inkscape generating the previews for all fonts).
* By default on Linux, the drop-down is shown as a menu (gray background, wide panel without horizontal scrolling) instead of a list (white background, narrow panel with horizontal scrolling). The menu style is inconvenient because of its excessive width. To fix this, find your ~/.gtkrc-2.0 file and inside the style that applies to all widgets, add GtkComboBox::appears-as-list = 1. For example:
style "user-font" { font_name="DejaVu Sans 10" GtkComboBox::appears-as-list = 1 } widget_class "*" style "user-font"
Windows version uses the list style by default.
I should add that, after several days of tweaking this, starting from a patch by Felipe, I hate GTK more than ever. Its inconsistent behavior across platforms, poor configurability (can anyone please suggest how the list style can be set programmatically, not via an rc file? this style property is read-only in GTK!) and ambiguous documentation are really a shame. In the end I fixed everything except the above listed issues, using a few weird tricks but nothing really insane (standard GTK widgets only), and I think it should be good enough to release in 0.47. If and when someone comes up with a more advanced solution, it must be at least as good usability-wise as this one.
I tested it on Linux with GTK 2.15.4 and on Windows XP. Please report any problems to me, listing your platform and GTK version.

Gentoo Linux GTK+ 2.14.7-r2 (highest version marked stable on Gentoo at the moment); Inkscape svn21520
There is a long delay when first selecting the font menu which I assume is the drawing of the samples. With a lot of fonts it is disconcerting but okay when you're expecting it, and it does only happen the first time you select the menu so it's not too much of a big deal. At least, not compared to the other problem.
It doesn't actually change the font for me. The name in the box changes but as soon as I start to type it reverts to whatever the previous setting was. If I select some already placed text, highlight the characters and then select a new font then the name in the fontbox doesn't even change.
The only way to change the font is to type some text, go into the text dialogue and change it there. Whatever font I pick in that dialogue is the one I get with the text tool from then until I go back and change it. It doesn't matter if I have the text tool set to "last style used" or "own style".
Sorry :(
I'm with you 100% in the GTK thing too. It drives me mad that I can't select my printer from GTK programs because the library ignores printcap printers and the fileselector is cluttered up with all sorts of shortcuts I can't change or delete. Configuration is a dark art and the library seems to assume that you're running a GNOME desktop much of the time.
Bah!
TWW
On Tue, 09 Jun 2009 06:51:30 +0100, bulia byak <buliabyak@...400...> wrote:

On Tue, Jun 9, 2009 at 6:45 AM, Thomas Worthington<thomas@...2129...> wrote:
Descriptions in terms of "change" and "select" are too ambiguous to debug, given the granularity of GTK stupidity :) Please send me a scenario detailed to the maximum: exactly what keys and mouse buttons you press in what order, starting with launching a new copy of the program. Also, I assume you can recompile Inkscape, so that I can remotely debug your problem by inserting some debug output?

On Tue, 09 Jun 2009 15:43:01 +0100, bulia byak <buliabyak@...400...> wrote:
Okay:
1. Start Inkscape. 2. Click on text tool (ie, the capital A in the toolbar). Bitstream Vera Sans appears in the text toolbar drop-down 3. Click on the down arrow to select a new font. Wait 9 to 11 seconds for menu to appear. 3. Select "Adobe Caslon Pro". The drop-down now displays "Adobe Caslon Pro". 4. Click on the canvas to start typing. Text cursor appears and starts flashing. 5. Start typing. The selected font reverts to Vera Sans, and that is displayed in the drop-down. 6. Change the font in the drop down back to Caslon (without leaving the text object created at step 4) and continue typing. Font reverts again to Vera Sans. 7. Finish typing by pressing escape. 8. Select the text object using the mouse and the normal pointer (the big arrow icon in the toolbar). 9. Open the "Text and Font (Ctrl+Shift+T)" dialogue. 10. Select and apply Caslon. The actual font used in the text object changes to Caslon as it should. 11. Click on "Set as Default" 12. Close Text and Font dialogue. 13. Create a new text object as per steps 2 and 3. Text cursor flashes and the current font is displayed as Caslon in the dropdown. 14. Start typing. Font reverts to Vera Sans.
The same happens with fonts other than Caslon. Sometimes, when I start Inkscape, the font it insists on reverting to is something other than Vera Sans; usually something I had used the previous time I was working with Inkscape. But it seems to always return to Vera Sans eventually.
That any clearer? I can certainly compile with some debug code added and send you the output if you want.

thanks! now please uncomment line 6018 in src/widgets/toolbox.cpp and recompile, then repeat steps 1 to 5, and send me the console output you get

On Tue, 09 Jun 2009 16:22:09 +0100, bulia byak <buliabyak@...400...> wrote:
Here it is. The first line appeared as soon as I selected the text tool; the second line when I changed the font and the following warnings in sets of three as I typed characters. The final line, about Pango, appeared doing closedown of the program.
TW
---------------------
** (inkscape:21497): WARNING **: Family name Bitstream Vera Sans does not have an entry in the font lister. family changed to: Adobe Caslon Pro
** (inkscape:21497): WARNING **: Family name Bitstream Vera Sans does not have an entry in the font lister.
** (inkscape:21497): WARNING **: Family name Bitstream Vera Sans does not have an entry in the font lister.
** (inkscape:21497): WARNING **: Family name Bitstream Vera Sans does not have an entry in the font lister.
** (inkscape:21497): WARNING **: Family name Bitstream Vera Sans does not have an entry in the font lister.
** (inkscape:21497): WARNING **: Family name Bitstream Vera Sans does not have an entry in the font lister.
** (inkscape:21497): WARNING **: Family name Bitstream Vera Sans does not have an entry in the font lister.
** (inkscape:21497): WARNING **: Family name Bitstream Vera Sans does not have an entry in the font lister.
** (inkscape:21497): WARNING **: Family name Bitstream Vera Sans does not have an entry in the font lister.
** (inkscape:21497): WARNING **: Family name Bitstream Vera Sans does not have an entry in the font lister.
** (inkscape:21497): WARNING **: Family name Bitstream Vera Sans does not have an entry in the font lister.
** (inkscape:21497): WARNING **: Family name Bitstream Vera Sans does not have an entry in the font lister.
** (inkscape:21497): WARNING **: Family name Bitstream Vera Sans does not have an entry in the font lister.
** (inkscape:21497): WARNING **: Family name Bitstream Vera Sans does not have an entry in the font lister.
** (inkscape:21497): WARNING **: Family name Bitstream Vera Sans does not have an entry in the font lister.
** (inkscape:21497): WARNING **: Family name Bitstream Vera Sans does not have an entry in the font lister.
** (inkscape:21497): WARNING **: Ignoring font without family that will crash Pango

Thanks! so it looks like I'm not to blame: the GTK widgetry works and passes control to the font setter:
family changed to: Adobe Caslon Pro
and it fails after that, in the code which I didn't change. Looks like that "stuck with Sans" bug which I assumed fixed (I don't see it) is still there. I will now simply copy the font-setting code from the font dialog to the toolbar so it's simple and consistent everywhere.

OK, the stuck-with-sans bug and the unability to change font should be fixed in 21527. Please test and let me know!

It works now, but if I try to change focus to another window, while the dropdown list is active, the Inkscape window will stay on top of all other windows (except windows, which have explicitly been created always on top). When the window is locked in this position, it can't even be closed in normal ways (like Alt-F4). Pressing Ctrl-C, when the console window is active does kill the process.

On Wed, Jun 10, 2009 at 11:38 AM, Preben Soeberg<prsodk@...400...> wrote:
Yes indeed. But this time, it is no fault of Inkscape at all. We use a purely standard GtkComboBoxEntry widget which creates a drop-down itself. So this is a bug in GTK's windows port. I cc Tor Lillqvist who may be able to look into this or direct us to another developer.
Tor: This is a trouble with a GtkComboBoxEntry on Windows XP.

On Wed, 10 Jun 2009 13:11:07 +0100, bulia byak <buliabyak@...400...> wrote:
OK, the stuck-with-sans bug and the unability to change font should be fixed in 21527. Please test and let me know!
Working fine here now (Gentoo). Good work, much appreciated.

On Tue, 2009-06-09 at 02:51 -0300, bulia byak wrote:
You probably want gtk_rc_parse_string and gtk_widget_set_name. Here's a code snippet from the indicator-applet. (note: the names are slightly complex as we had to lie about our type for some backwards compatibility, but you get the idea)
gtk_rc_parse_string ( "style "indicator-applet-style"\n" "{\n" " GtkMenuBar::shadow-type = none\n" " GtkMenuBar::internal-padding = 0\n" " GtkWidget::focus-line-width = 0\n" " GtkWidget::focus-padding = 0\n" "}\n" "style "indicator-applet-menubar-style"\n" "{\n" " GtkMenuBar::shadow-type = none\n" " GtkMenuBar::internal-padding = 0\n" " GtkWidget::focus-line-width = 0\n" " GtkWidget::focus-padding = 0\n" " GtkMenuItem::horizontal-padding = 0\n" "}\n" "style "indicator-applet-menuitem-style"\n" "{\n" " GtkWidget::focus-line-width = 0\n" " GtkWidget::focus-padding = 0\n" " GtkMenuItem::horizontal-padding = 0\n" "}\n" "widget "*.fast-user-switch-applet" style "indicator-applet-style"" "widget "*.fast-user-switch-menuitem" style "indicator-applet-menuitem-style"" "widget "*.fast-user-switch-menubar" style "indicator-applet-menubar-style""); gtk_widget_set_name(GTK_WIDGET (applet), "fast-user-switch-applet");
--Ted

On Fri, Jun 12, 2009 at 1:12 AM, Ted Gould<ted@...11...> wrote:
You probably want gtk_rc_parse_string and gtk_widget_set_name.
Thanks, this worked!
participants (6)
-
Alexandre Prokoudine
-
bulia byak
-
Joel Holdsworth
-
Preben Soeberg
-
Ted Gould
-
Thomas Worthington