Switching font with up/down arrows de-selects font list box

Bug #900602 reported by cadabra on 2011-12-06
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Kayo Hamid

Bug Description

This is a UI enhancement request. I'd like a way to type some text and quickly see what it looks like in different fonts. This would be straightforward if I could navigate the Font Family select list box using the arrow keys. Unfortunately, using the arrow keys changes the font only once, and then the list box loses focus.

Steps to reproduce

 - New document
 - Text tool
 - Add some text
 - Focus `Select Font Family` in the toolbar by, e.g. clicking on the font name
 - Press the up or down arrow key
 - The selected font changes to the previous or next font
 - The font box loses focus

Expected behavior

 - The font family box retains focus and I can continue using the arrow keys to select different fonts


 - Inkscape 0.48
 - Mac OS X 10.7.2
 - XQuartz 2.6.3 (xorg-server 1.10.3)

su_v (suv-lp) on 2011-12-06
Changed in inkscape:
importance: Undecided → Wishlist
su_v (suv-lp) wrote :

Reproduced with Inkscape 0.48.2 and 0.48+devel r10760 on Mac OS X 10.5.8 (i386)

Workaround for a keyboard-only navigation:
1) New document
2) Text tool
3) Add some text
4) move focus to the font family selector with 'Alt+X' [1]
5) use arrow key to switch to next lower or upper font family
   -> focus switches back to canvas
6) move focus to the font family selector with 'Alt+X'
7) use arrow key …

[1] <off-topic>
Note: with a recent version of X11 (on Mac OS X Snow Leopard and Lion) or Xquartz (on Mac OS X Leopard) , change the X11 Input preferences to '[x] Option keys send Alt_R and Alt_L' to make the opion/alt key behave as expected in shortcuts under X11.
Alternatively see the old method as described in the FAQ: <http://wiki.inkscape.org/wiki/index.php/FAQ#How_to_make_the_Alt_key_work_.3F>

Changed in inkscape:
status: New → Confirmed
tags: added: fonts
su_v (suv-lp) wrote :

@JazzyNico, @Alvin - could you test this on Linux/Windows? I doubt that it is limited to OS X port of Inkscape. (I also reproduced it with a Gtk+/Quartz based build of inkscape trunk (here, instead of 'Alt+X' one needs to use 'Alt+Cmd+X' in the text tool context to move the focus to the font family selector)).

su_v (suv-lp) on 2012-06-29
tags: added: text
su_v (suv-lp) on 2012-06-29
summary: - Mac: Switching font with up/down arrows de-selects font list box
+ Switching font with up/down arrows de-selects font list box
Kayo Hamid (khflab) wrote :

Sending to review.

I'm pretty new with bazar, and i do 'bzr send -o' to generate this patch, it's ok or is better do bzr diff?

Kayo Hamid (khflab) wrote :

using diff now. sending for review.

Kris (kris-degussem) wrote :

Confirmed bug and fix on windows vista 4 bit.
Fix committed in revision 11622 for trunk.

Changed in inkscape:
status: Confirmed → Fix Committed
assignee: nobody → cadabra (cadabra123)
milestone: none → 0.49
su_v (suv-lp) wrote :

Reopening: IMHO this patch needs to be discussed first - in its current form, it breaks workflows based on keyboard navigation when editing/formatting text , similar to bug #687517: when changing the font family with keyboard input only (in the text tool, use 'Alt+X' to move focus to the font selector widget, type a few letters to get a dropdown of matching font names, use the arrow key to select one, and continue entering text on-canvas) the mouse focus is anywhere but not on the canvas after having pressed the arrow keys and selected a different font family, and entering more text may trigger "random" commands (depending on which UI widget the focus has shifted to (I had text getting flipped horizontally unintentionally, or tools switched etc.).

I think we need a solution which defines an obvious way how to move the focus from the font selector widget back to the canvas with the keyboard (i.e. without having to grab the mouse and explicitly clicking on the canvas to be sure that continuing typing text actually does append to the currently selected text object, and without risking to lose the current selection on-canvas either):
Maybe an explicit <return> could be used to move the focus back to the canvas after having selected a new font with the arrow keys? (I'm not a GUI expert myself though)

Changed in inkscape:
status: Fix Committed → Confirmed
su_v (suv-lp) wrote :

- Reopening: IMHO this patch needs to be discussed first
+ Reopening: IMHO this patch should have been discussed first

su_v (suv-lp) wrote :

'In Progress' is probably better as bug status (since the current patch is already committed).

Changed in inkscape:
status: Confirmed → In Progress
su_v (suv-lp) wrote :

Forgot to mention: comment #6 is based on testing r11622 on OS X 10.7.4 with GTK+/X11 2.24.10 (default build, not bundled as osxapp). Apparently, <return> works just fine with Windows builds to return the focus from the font family selector to the currently edited text on-canvas (based on feedback by Kris on irc).

su_v (suv-lp) wrote :

> I think we need a solution which defines an obvious way how to move
> the focus from the font selector widget back to the canvas with the
> keyboard

Confirmed by ScislaC (current trunk, Ubuntu Quantal)

su_v (suv-lp) wrote :

@cadabra - I have tried to find older discussions about when/why the line of code your patch comments out (to prevent the focus from being returned to the canvas) had been added (with limited success). A short discussion during the major rewrite of the font selector widget for Inkscape 0.47 can be found e.g. in the comments of Bug #168161 (comment #30 and below):

bbyak wrote on 2009-05-26:
> Felipe "Juca" Sanches wrote on 2009-05-26:
>> bbyak wrote on 2009-05-26:
>>> - type some text, select it, open the drop-down, navigate by keys, press
>>> Enter. The font is assigned. Now press left-arrow - instead of moving
>>> text cursor, it highlights the font name in the toolbar. To fix,
>>> whenever you close the drop-down, either by choosing a font or by
>>> escaping, you must pass focus to the canvas - see spinbutton_defocus for
>>> how to do this.
>> There is one issue with grabbing focus to canvas. One user told me he
>> would like to select the text, then select a font and then keep
>> switching fonts with up/down arrow keys so that he can decide which font
>> looks good in his design. It seems to be a reasonable request.
> Absolutely! That is the best thing about your patch :) Let's not lose
> this capability whatever else we fix. I was only speaking about moving
> focus to canvas when you _close_ the drop-down.

Apparently the feature mentioned by Felipe to scroll through the list of fonts with arrow up/down keys got lost due to later changes (it works as described in Inkscape 0.47 but no longer in Inkscape 0.48.0 and current trunk). The statement by bbyak about the focus having to move back to the canvas when the drop-down is closed (i.e. a font family is actually selected) is unambiguous though AFAIU.

Expected behavior (AFAIU):
Edit a text object on-canvas, move focus with 'Alt+X' to the font selector ->
a) use arrow keys to switch through the list of fonts, select a new font with <Return>
-> focus is moved back to canvas to the text object currently being edited.
b) use the type-ahead feature to get a drop-down list with matching fonts, select a new font with the arrow keys, press <Return>
-> the drop-down list is closed and the focus moved back to canvas to the text object currently being edited.
See also:

I'm proposing to revert the commit of the current patch - the goal ought to be to restore the features from Inkscape 0.47 (which seem to have been lost in Inkscape 0.48 - possibly during the conversion of the text toolbar to a GTK toolbar, or when adding new features to the GUI of the text tool), without introducing new regressions (e.g. interrupting keyboard-based workflows while editing and formatting text content).

tags: added: regression
su_v (suv-lp) wrote :

- @cadabra - I have tried to find older discussions about (…)
+ @Kayo - I have tried to find older discussions about (…)

@Kayo - sorry for my mistake (I didn't double-check the full name of the assignee and failed to notice that the report had been assigned to the reporter instead of to you).

-> reassigning report to Kayo, who contributed the patch currently committed in trunk.

Changed in inkscape:
assignee: cadabra (cadabra123) → Kayo Hamid (khflab)
John Smith (john-smithi) wrote :

I propose that we keep the current commit (since its very convenient), but also add the ability to return focus to the canvas by pressing <Enter>.
This is consistent with the other toolbar text entry widgets like the spinbuttons.

Attached patch adds this functionality to the font family combo as well as the font size and variant.

Kayo Hamid (khflab) wrote :

I tested and works!

su_v (suv-lp) wrote :

@John - would it be possibly to have <esc> also return focus to the currently edited text object on-canvas (like it did in Inkscape 0.47), same as with <return>?

In Inkscape 0.48 and current trunk (without or with your patch), the result of <esc> is kind of a "no-man's-land" with regard to current focus for keyboard input, and does not allow to keep the current selected text object unless resorting to the mouse.

John Smith (john-smithi) wrote :

Committed as r11676 : <Esc> key also returns focus to canvas selection.

@Kayo, thanks for the patch !

Changed in inkscape:
status: In Progress → Fix Committed
su_v (suv-lp) wrote :

@Kayo and @John - many thanks for your combined efforts to improve font selection and keyboard-based workflows while adding & editing text in Inkscape :)

Bryce Harrington (bryce) on 2015-02-23
Changed in inkscape:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers