precompute character widths for faster string measuring