Drawing strokes with a different width at each point of the lines/curves

I'm using SwiftUI to draw handwritten strokes using paths made from sequences of lines and curves.

For this I need to be able to draw the stroke with a width per point, not per stroke.

Any idea on how to achieve that ?

Or to emulate it using some other lower-level base library ?

Make separate paths for the two sides of the stroke, and fill the area in between.

So basically you mean it's not possible so specify the width per point, so I'll have to do all the math myself to generate the cubic curves at each point and between them. Yay...

You may get some inspiration from GitHub - alankarmisra/SwiftSignatureView: A lightweight, fast and customizable option for capturing fluid, variable-stroke-width signatures within your app., a library that never failed me in several years.

1 Like

Very instructive ! Exactly what I was looking for :)