Calculate text width in Application