This exchange about writing the infinity symbol using a calligraphic pen nib (https://mathematica.stackexchange.com/a/13376/43662) gave me an idea that is a bit steep for me to implement.
The idea is to create a large pane (a DynamicModule
with a TouchPosition
?) which on a machine with a touchscreen can be used to create a signature and export it to any graphics format for use in letters. The pane would track touching it (or clicking the mouse and moving it) and repeatedly so (i.e., raise the pen and write again). The result would be the signature but without the calligraphic pen effect.
Then, akin to the answer above, the user would assess the effect of changing the nib angle, width, and ink color. The user would save the shape for adjusting again in the future and export the calligraphic signature for importing into letters.
To Be Updated as We Work this Out: After updating according to N0va's first attempt and Michael E2's cautionary note I am trying to use MousePosition
instead of TouchPosition
until we get this code working but I am stuck. My goal is something akin to:
DynamicModule[{pt=Dynamic@MousePosition["Graphics"],tmp},(
tmp=If[pt!=None&&pt!=tmp[[-1]],AppendTo[tmp,pt],{0,0}];
Graphics[{...,Line@tmp])]
Accordingly, following None's example with LocatorPanel
, I produced the following code, which does not produce a similar result:
DynamicModule[{pt = Dynamic@MousePosition["Graphics"], tmp = {}}, {
Dynamic@Graphics[{
Line@{{2.5, 2.5}, pt},
, Line[AppendTo[tmp, pt]]}, Frame -> True, ImageSize -> Medium,
PlotRange -> {{0, 5}, {0, 5}}], pt, tmp}]
The last instance of tmp
never appears different than {}
. However, when I move the mouse fast inside the graph, a line of a few points corresponding to a tmp
different than {}
does appear:
Why does tmp
get reset?
Dynamic[]
in there somewhere. $\endgroup$Dynamic@gr
does not do it. $\endgroup$TouchPosition
is supposed to work? The docs do not putDynamic
on the enclosing head. (I don't thinkgr
can be the head of an enclosing object. Probably it should beGraphics
.) See how N0va usedDynamic
to updatetmp
. $\endgroup$