Skip to content

Rework text decorations so they are calculated as per css-text-decor-4

  • We now try to follow css-text-decor-4 for the generating of the lines.
    • In particular that spec requires line-through to be recalculated when the font-size changes.
    • This also makes it so that text-decorations play nice with baseline-shift and alignment.
    • Similarly, the stroke width for the text decorations is now calculated properly.
  • Painting the text decorations has been improved: We now support gradients on them properly, as well as following the spec more closely regarding overlaps.
  • The QML widget has been improved with the ability to actually choose the line color.

image

I had added icons, but it doesn't seem that fusion actually makes use of those for checkboxes. Similarly, I had considered switching "wave" style to use actual sinusoïd waves, but then realized I didn't really know how to approach splitting those halfway. I might take a look at it at some other time.

No updated unittests for these. These need render tests, and I want to finish some other rendering related things before I start updating the render tests again.

Test Plan

  • Set some text-decorations on a text
  • set some on a smaller subsection
  • change line color
  • play with dominant baseline, alignment baseline and baseline shift and see how they affect the decorations.
  • play with font-size and see how that affects the decorations.
  • play with writing-mode vertical and idem.

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!)
  • 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?

Merge request reports

Loading