Type Setting Mode

This adds a new button called "Type Setting Mode" to the text tool options.

Right now, it draws the baselines, and when in preformatted/prepositioned mode, it'll allow editing the local transforms with two nodes.

TODO:

  • Allow editing local transforms when text is not wrapping.
    • For text-on-path, stuff needs to be done after the text branch is merged.
  • Allow changing fontsize and baseline shift by dragging the relevant baselines.
  • Allow selecting the dominant baseline.

See also: woltherav/krita#28 (closed)

Test Plan

  1. Create a text.
  2. Enter "Type Setting Mode" in text tool options.
  3. Select an area in the text. Drag the different lines to change their values. If there's no selection, it'll change these values for the paragraph.
  4. Now, ensure that the text is either preformatted or pre-positioned, so you can see the character transform handles.
  5. Move around the character transform handles.
  6. Finally use shift to switch the available handle to baselines. Click a non-current baseline to set it as the dominant baseline. This is most obvious with different size text.

There's also a few actions to have the movement of the character transform start handle. These are called "Move Text Selection x by 1 pixel", and can currently be found among the shortcuts or the ctrl+enter menu. These are only for offsetting the selection, as I suspect that is going to be the primary usecase.

Absolute position adjustment is not enabled right now.

Formalities Checklist

  • I confirmed this builds.
  • I confirmed Krita ran and the relevant functions work.
  • I tested the relevant unit tests and can confirm they are not broken. (If not possible, don't hesitate to ask for help!) Tests needed:
    • preformatted
    • preformatted rtl
    • preformated vertical
    • prepositioned with absolute positioning
    • prepositioned with relative positioning
    • prepositioned with mixed positioning
    • preformatted with bidi controls.
  • I made sure my commits build individually and have good descriptions as per KDE guidelines.
  • I made sure my code conforms to the standards set in the HACKING file.
  • I can confirm the code is licensed and attributed appropriately, and that unattributed code is mine, as per KDE Licensing Policy.
  • Does the patch add a user-visible feature? If yes, is there a documentation MR ready for it at Krita Documentation Repository?
Edited by Wolthera van Hövell

Merge request reports

Loading