#8492:fix endless loop when dimensions that are not enough to fit one character