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 https://github.com/alankarmisra/SwiftSignatureView, a library that never failed me in several years.

1 Like

Very instructive ! Exactly what I was looking for :)

Terms of Service

Privacy Policy

Cookie Policy