There's several problems here that are just abut modernising the calligraphic tool base and barely touch making it more usable.
Outline, code:
----------------
* `KoParametricShape` is a `KoPathShape` that has a list of handles and parameters that can be modified.
* `KarbonCalligraphicShape` is a `KoParametricShape`.
* Which has `KarbonCalligraphicPoint`s. - These only contain a point, a width and an angle.
* The `KarbonCalligraphicTool` generates a `KarbonCalligraphicShape`.
Problems:
------------
* `KoParamtericShape` is intended to have some handles that generate a path, but mostly like circles, rectangles, stars, etc. (This could be a good candidate for a python plugin btw). It is not really intended for something that can generate a similar path, like the `KarbonCalligraphicShape`.
* This means no add/remove/insert nodes.
* No different node types either.
* This is what causes the 'move node and have the path run off bug', it's a problem in `KoCalligraphicShape::normalize()`.
* There's no saving of the spine-path.
* This path shape currently only saves the width and angle of a given path, while it might be better if we could store the KisPaintInformation instead.
Solutions:
-----------
Either we...
### Keep KarbonCalligraphicShape a KoParametricShape.
And then extend the calligraphic tool to handle add/remove of points.
Cons:
* This doesn't make much sense from the user point of view. Why would the node editing tool only be able to edit the points, but not adding removing points.
* On the other hand, this does simplify the question of where a hypothetical kispaintinformation-editor would go.
* You'd still need to fix the normalize bug.
* Isn't flexible in the long term.
* for example, if we have a situation where the intersection of two calligraphic path spines would need to be calculated, `KoParametricShape` just isn't capable of that.
### Make KarbonCalligraphicShape a KoPathShape
We make this a KoPathShape with a KoPathShape inside, the latter will contain the 'rendered stroke', we override the paint() and paint that 'rendered stroke' instead. We also keep a list of KisPaintInformations.
Cons:
* Needs a whole lot of rewriting:
* We need to be mindful of subpaths.
* We need to override add/remove/combine/seperate.
* The path rendering needs to be done as such that we can handle different path types
* We need to find a solution for convert-to-path.
* Will need a whole lot of testing for edgecases.
Battle plan:
-------------
- [x] Convert `KarbonCalligraphicPoint` to a `KoPathPoint` with a `KisPaintInformation`.
- [x]OR Convert `KarbonCalligraphicPath` to a `KoPath` instead of `KoParametricPath`. [Turned out too difficult]
- This would need to become a `KoPathShape` with a `KoPathShape` inside, the later containing the rendered stroke.
- Store the `KisPaintInformation`s in a list.
- No idea how to implement convert to path here...
- [x] Make `KarbonCalligraphicShape` render with these new KarbonCalligraphicPoints (and use the relevant similar bits from )
- [x] Make the Calligraphy tool generate these simply for now.
- [ ] Verify that the Alternate pointtypes render sensibly. (big, mostly cusp is a problem)
- [ ] Allow *stroke selected shapes* to stroke calligraphic strokes with the relevant bits. We can try to check the shapeID to see if it's possible.
- [ ] Make a KarbonCalligraphicShape config object. This is like a preset, it will allow people to modify the shape based on the paintinfo instead of making the Calligraphy tool do that. (also big) [Using a KisPropertiesConfig now]
- Keep usePath
- [ ] Replace strokewidth, pressure and thinning by size sensor curve-widget in calligraphy tool.
- [ ] Move calc width to the stroke.
- [ ] Replace angle, fixation and custom angle with angle sensor curve-widget
- [ ] Move calc angle to the stroke.
- Keep caps.
- Keep mass and drag until better smoothing is implemented.
- [x] Make this path type save and load proper. This seems to be unimplemented. (needs input on how it should look)
Save something like this?
```
<path
style="fill:#000000;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 114.28571,640.93363 c 1.96528,-0.89379 -1.33194,-14.65239 -3.87853,-31.5105 -2.68746,-17.7907 -4.48873,-37.56486 -3.1739,-58.03937 1.88174,-29.30254 9.80413,-54.02772 23.6747,-73.89615 13.58786,-19.46347 32.54488,-33.80754 56.07886,-44.15814 16.03322,-6.95659 29.86336,-8.18164 41.25597,-7.37414 11.5853,0.82115 22.63348,3.9201 32.786,7.88512 14.41689,5.63044 28.5889,13.65292 41.28598,21.51544 12.31181,7.62394 25.80375,16.74753 37.1699,24.26992 14.03531,9.28891 28.15513,18.39231 42.89161,26.49148 14.33815,7.88026 31.27473,15.9259 49.49391,21.06265 14.04122,3.9588 31.12793,6.84894 49.5381,5.00865 9.34159,-0.9338 19.15403,-3.09936 29.1008,-7.06683 9.97504,-3.97874 19.87612,-9.68506 29.51115,-17.54687 9.25068,-7.54818 17.38413,-16.37014 24.1574,-26.20236 -6.1289,-5.98368 -12.02883,-12.19748 -17.68708,-18.62804 -22.80886,-25.92207 -41.4997,-55.14845 -53.82832,-88.30825 C 480.15548,340.79727 474.9125,305.02 476.82408,267.38582 c 2.21568,-43.62102 19.13011,-99.7235 17.46163,-100.7379 -2.5573,-1.55478 -12.71633,10.82215 -22.31047,28.51715 -9.94042,18.33367 -19.20149,41.68451 -25.2567,67.87052 -9.37262,40.53231 -10.03521,82.9255 -0.83713,124.84737 5.58682,25.46297 14.53134,49.559 26.12819,72.1967 -5.00436,-1.23024 -10.32199,-3.11487 -15.85032,-5.48309 -10.56704,-4.5267 -22.06844,-10.8863 -34.3231,-18.08986 -8.26071,-4.85583 -29.54787,-17.77758 -40.48489,-24.17314 -12.26359,-7.17129 -27.30249,-15.64661 -43.22492,-23.25834 -15.75337,-7.53091 -35.87451,-15.93519 -57.8892,-20.96925 -15.70667,-3.59161 -34.09651,-5.88388 -53.96971,-4.05519 -20.07279,1.84706 -42.02784,7.91841 -64.68282,21.62982 -29.53292,17.97724 -52.4959,41.82714 -66.457196,71.64804 -13.948286,29.79311 -17.438963,62.44561 -13.542334,94.90605 4.93611,41.11973 26.57007,91.48704 32.7006,88.69893 z"
id="path4136"
krita:original-d="m 114.28571,640.93363 c 0,0 -73.004042,-160.52221 60,-231.42857 133.00404,-70.90636 247.51153,143.98617 347.51153,72.5576 C 398.41014,324.34377 494.28571,166.64792 494.28571,166.64792"
calligra:nodetypes="czcc">
<paintInfo pointX pointY pressure Xtilt yTilt rotation tangentialPressure perspective time speed />
<paintInfo pointX pointY pressure Xtilt yTilt rotation tangentialPressure perspective time speed />
<paintInfo pointX pointY pressure Xtilt yTilt rotation tangentialPressure perspective time speed />
<paintInfo pointX pointY pressure Xtilt yTilt rotation tangentialPressure perspective time speed />
<paintInfo pointX pointY pressure Xtilt yTilt rotation tangentialPressure perspective time speed />
</path>
```
See [this for saving and loading](https://phabricator.kde.org/R37:d2266b464fb97462f06d4e7bfd898724fa95862b#42535b62)