improved measuring of text