Text this: Applications of discrete geometry and mathematical morphology