Page 1 of 1

Node alignment

Posted: Sun Nov 27, 2016 4:22 pm
by MikeW
It would be beneficial if when two or more nodes are selected that there be keyboard shortcuts for alignment.

For vertical alignment:

l = left
c = center
r = right

For horizontal alignment:

t = top
m = center
b = bottom

Edited to incorporate BP's suggestion for horizontal center alignment...

Re: Node alignment

Posted: Sun Nov 27, 2016 4:45 pm
by Bhikkhu Pesala
I agree that this would be useful. Node alignment is a common task that takes rather too long with the Align Toolbar, and I often make the wrong choice.

Shortcut c is currently used to switch to colour mode, but I see no reason why it cannot serve two functions, depending on the context. Shortcut b = Paint Bucket in Colour mode.

I think m = middle would be better than having two items called center.
Align Middle.png
Align Middle.png (11.8 KiB) Viewed 13827 times
The following single-key shortcuts are already in use in the Glyph Edit Window:-
  • N = Change selected points to on curve
  • F = Change selected points to off curve
  • G = Add guideline through two selected nodes, or add orthogonal guidelines at a single selected node
  • A = Add points after selected points
  • O = Toggle Fill Outline
  • H = While pressed down, hides everything except the glyph
  • Q = Select previous contour/point index or composite glyph member. Use SHIFT to add to current selection.
  • W = Select next contour/point index or composite glyph member. Use SHIFT to add to current selection.
  • P = Toggle between point and contour mode
  • C = Toggle between standard and color mode
  • K = Knife (not in color mode)
  • M = Measure
  • B = Paint bucket (only in color mode)
  • / = Fit to Window

Re: Node alignment

Posted: Sun Nov 27, 2016 5:38 pm
by MikeW
Yep, I read the help about the shortcuts already assigned. And context would take care of the overlap as mentioned.

m would work, thanks.

Re: Node alignment

Posted: Sun Nov 27, 2016 8:50 pm
by Bhikkhu Pesala
MikeW wrote:Yep, I read the help about the shortcuts already assigned. And context would take care of the overlap as mentioned.

m would work, thanks.
What if one is editing a colour glyph outline, selects two or more nodes to align them, then presses c or m? How does FontCreator know if the user wants to align the nodes, preview the edited glyph in colour or measure the distance between nodes?

Re: Node alignment

Posted: Mon Nov 28, 2016 12:30 am
by PJMiller
Bhikkhu Pesala wrote:
MikeW wrote:Yep, I read the help about the shortcuts already assigned. And context would take care of the overlap as mentioned.

m would work, thanks.
What if one is editing a colour glyph outline, selects two or more nodes to align them, then presses c or m? How does FontCreator know if the user wants to align the nodes, preview the edited glyph in colour or measure the distance between nodes?
I think that the alignment functions are more used and useful than the colour functions so it would make more sense for the alignment functions to get the keystrokes because it wouldn't be that much hassle for the colur functions to be available only from toolbar buttons or menu items.

Re: Node alignment

Posted: Mon Nov 28, 2016 12:59 am
by MikeW
Yeah, what he said...

The obvious, fuller, and unfortunately for Erwin more work, solution is to allow customizable keyboard shortcuts. However, the ability to customize keyboard shortcuts allows the best option. Even if there was no interface in the UI for doing so (which is a large part of the making it possible), keyboard shortcuts could be made available in an .ini file any person could edit and FC could read that .ini file and populate the variables at start-up.

While it might seem unprofessional, it's how we all programmed back in the day for various user-configurable features.

Re: Node alignment

Posted: Sun May 14, 2017 5:19 am
by Bhikkhu Pesala
This is, in effect, implemented now. Not with shortcut keys as requested, but with access keys. For example, to align the selected nodes to the Top:
  1. Press Shift F10. This will display the context menu at the current mouse cursor position
  2. Hit access key "b" to show the Align or Distribute submenu.
  3. Hit access key "t" to align the nodes to the Top, "b" for Bottom, "m" for Middle,
    etc.
It does take three key presses instead of only one, but it does not require the use of a mouse, and one only needs to remember Shift F10 (or the Menu Key, to the left of the Control key on the right of the keyboard). Shortcuts are precious and it's hard to avoid conflicts while keeping them easy to remember.
Align or Distribute Access Keys.png
Align or Distribute Access Keys.png (36.38 KiB) Viewed 13609 times