Distance measurements and their combination in handwritten character recognition