WIP Test of new GUI for 'writing-mode' and 'direction'.

Open username-removed-405008 requested to merge rtl_direction_gui into master

This is an experiment to try to improve handling of right-to-left text. I would like feedback from those who use right-to-left text on a regular basis as to the usefulness of this branch.

The 'writing-mode' property sets the block direction of text:

  1. Horizontal top-to-bottom text.
  2. Vertical left-to-right text.
  3. Vertical right-to-left text.

Where 'top-to-bottom', etc. indicates the direction sequential lines are placed. Currently in trunk there is one set of three buttons to set this property. In SVG this property is only applied to the element.

The ordering of characters in horizontal text (right to left, left to right) is determined primarily by the Unicode properties of the characters. There are some characters that are ambiguous, such as '!'. The ordering of these characters is determined by the 'direction' property. In principle 'direction' can be set on individual elements but it has an effect only if the 'unicode-bidi' property is set to 'override' (useful if one, for example, quotes an Arabic sentence inside an English sentence). Inkscape has no support for the 'unicode-bidi' property so in practice only the 'direction' value on the element is used.

The 'direction' property also sets the reference for the 'text-anchor' property for horizontal text (it should have no effect on the 'text-anchor' property for vertical text; currently in Inkscape it does and this is a bug).

This experiment merges the setting of 'writing-mode' and 'direction' (for horizontal text only) in one set of buttons. Four options are given:

  1. Horizontal top-to-bottom, left-to-right text.
  2. Horizontal top-to-bottom, right-to-left text.
  3. Vertical right-to-left, top-to-bottom text.
  4. Vertical left-to-right, top-to-bottom text.

Where the second set of 'left-to-right' etc. indicates the flow of characters in a line.

The 'direction' buttons are disabled for the horizontal modes and enabled for the vertical modes (to control 'direction' for normally horizontal text embedded inside vertical text).