So based on the image you provided all of their shapes can be done without taking your finger off of the screen.
They probably have a gesture library that holds the shapes in the form of nodes & from the moment you touch the screen to the moment you take your figure off the current gesture is recorded.
Then compare the recorded to the best fit in the library (if there is one) then do wants needed for that gesture.
More complex shapes like an X are trickier as you would want to remove your finger to draw it. You may want to have a gesture input mode where the user can draw the spell then when they are happy with it they can trigger the effect manually (Comparing it to a gesture library to work out what they drew).