Using Strings for On-Line Handwriting Shape Matching: a New Weighted Edit Distance