fix bug that text width calculation does not refer screen dpi