personalizedrefrigerator / js-draw

Draw pictures using a pen, touchscreen, or mouse! JS-draw is a freehand drawing library for JavaScript and TypeScript.
https://personalizedrefrigerator.github.io/js-draw/typedoc/
MIT License
79 stars 8 forks source link

Better stroke smoothing #20

Open personalizedrefrigerator opened 1 year ago

personalizedrefrigerator commented 1 year ago

Currently, js-draw uses heuristics to fit pen input points to Bézier curves. The current stroke smoothing method leads to handwriting that looks somewhat like this:

Screenshot: "Test" written. The "e" and "s" letters look un-smooth

While the current stroke smoother has the advantage of producing a small number of curves (good because js-draw drawings are uncompressed, Joplin seems not to support SVGZ), it makes handwriting somewhat difficult to read.

Progress

personalizedrefrigerator commented 8 months ago

Related: https://github.com/personalizedrefrigerator/joplin-plugin-freehand-drawing/issues/10

personalizedrefrigerator commented 5 months ago

Related: https://github.com/personalizedrefrigerator/js-draw/commit/e328438059316c44fb64efb23a947bf04ab954cb