This thesis focuses on modifying the open source speech recognition toolkit,Kaldi, to work for the task of handwriting recognition, also called text recognition.Various methods were explored to improve the performance of thetext recognition setup. Text recognition refers to the automatic transcriptionof handwritten or printed text inputs from sources such as text pageimages, personal digital assistants, electronic white-boards or other devices.Text recognition can be performed in both online and off-line scenarios. Offlinerecognition involves recognition of handwritten images whereas on-linerecognition also stores the time trajectory information of each stroke.Handwriting recognition has long been an active area of research and usesmany of the same models used to perform automatic speech recognition (ASR).One such model used in both tasks is the Hidden Markov Model (HMM).In handwriting recognition, the text line images are treated as observationsgenerated by underlying states representing the transcription. In this thesis,a hybrid deep-neural-network-HMM (DNN-HMM) acoustic model used forASR was adapted for text recognition. To overcome a major challenge ofout of vocabulary (OOV) words, a new subword based algorithm was implementedfor lexicon and language modeling. Different data augmentation and language specific modifications such as character decomposition, andbidirectional reordering were studied. To improve the performance of our textrecognition setup, shared models, semi-supervised training and a recurrentneural network language modeling were also used. We investigated the performanceof the text recognition setup on different languages, as well as whentrained on varying amounts of data of different resolution and background.We report competitive results on several commonly used handwritten andprinted text datasets.