Fixed exception when calculation font size