Atrament
A small JS library for beautiful drawing and handwriting on the HTML Canvas
Atrament is a library for drawing and handwriting on the HTML canvas.
Its goal is for drawing to feel natural and comfortable, and the result to be smooth and pleasing.
Atrament does not store the stroke paths itself - instead, it draws directly onto the canvas bitmap,
just like an ink pen onto a piece of paper ("atrament" means ink in Slovak and Polish).
This makes it suitable for certain applications, and not quite ideal for others.
⚠️ Note: From version 4, Atrament will only support evergeen browsers (Firefox, Chrome and Chromium-based browsers)
and Safari 15 or above. If your application must support older browsers, please use version 3.
Features:
- Draw/Fill/Erase modes
- Adjustable adaptive smoothing
- Events tracking the drawing - this allows the app to "replay" or reconstruct the drawing, e.g. for undo functionality
- Adjustable line thickness and colour
Enjoy!
Installation
If you're using a tool like rollup or webpack to bundle your code, you can install it using npm.
- install atrament as a dependency using npm install --save atrament.
- You can access the Atrament class using import { Atrament } from 'atrament';
Usage
- create a `