added helper function for qfontwidth checking