implementation of textBox and measureText