Text this: New Distance Measures for Arabic Handwritten Text Recognition