function to transform a text into horizontal blocks