optimize the font scaling performance