jakubfiala / atrament

A small JS library for beautiful drawing and handwriting on the HTML Canvas.
http://fiala.space/atrament/demo
MIT License
1.55k stars 116 forks source link

Just add some text labelling for drawings #96

Closed Easy-Cloud-in closed 6 months ago

jakubfiala commented 6 months ago

@Easy-Cloud-in thank you for opening the issue! What exactly do you mean by text labelling?

Easy-Cloud-in commented 6 months ago

If a draw a design in the atrament i want to label it. Let me be more specific, If we draw a cutting pattern, we like to name all the sides with a name and sizes for it. so it will be use full for us.

jakubfiala commented 6 months ago

Thank you for clarifying. Atrament operates on the <canvas> element you provide to it, so you can paint anything you want on the canvas, in addition to the Atrament drawing. To paint text, you can use the fillText method of the canvas rendering context. See here for a guide on how to do that. If you want to automatically add labels to individual strokes produced by Atrament, you can determine the location of each stroke using the strokerecorded event.

Hope that helps! I'm going to close the issue now, feel free to reopen it if you discover any issues.