How to change brush tip from circle to other shape to draw on canvas with javascript

I am drawing freehand on canvas with javascript and currently the line consists out of multiple circles drawn over each other to create the illusion of a line.

How can I set the default circle to irregulat shapes similar to photoshop brushes?
also related, this would be needed to create a calligraphy like stroke for a pen or marker.

any help, links or keywords for further research are aprechiated.