add 2D text writing function