Stroke-order-independent on-line character recognition algorithm and its application