I think I would do something like... making it actual line position lag 4 inputs behind, using some spline for the last... like... dunno... 6 points to that lagged point. On release finish the remaining stuff via spline-ing and enable antialiasing.

First off your aim is to second guess the users curve - knowing that it is likely to have inaccuracies. People have difficulty using the mouse, and quick strokes (even with tablets) are prone to a few errors so you want to smooth the curve out a little.

There is a general, all purpose smoothing method called low pass. It is so general that it is used by both music applications (as a low pass filter, and is an EQ filter) and in image applications as blur! In fact it belongs to the same family of processes that is used for image sharpening, sound frequency boosting and edge detection!!!

You will be doing a similar thing with paths. I have found an article explaining the basics of line smoothing algorithms. When calculating this from any given path you have the distances of the points as an estimation of the speed of drawing, however when your user has just drawn it you have the true speed of movement.

One thing that I always thought was missing from the many drawing packages was the ability to sketch a line - where you draw many short lines and will go over many of your lines. That way you have better data to work with and the user will be able to make much more accurate drawings!

P.s. my google search terms were "curve smoothing algorithm", take algorithm off of it and you will have a lot of non-helpful results

java-gaming.org is not responsible for the content posted by its members, including references to external websites,
and other references that may or may not have a relation with our primarily
gaming and game production oriented community.
inquiries and complaints can be sent via email to the info‑account of the
company managing the website of java‑gaming.org