measure the width a string will be when rendered in the dom