Measure and cache character pixel widths of styled content