This function searches for the minimum height of the font in order to reduce the number of extra points. To do this is through all the characters and the calculation of margins at the top and bottom of the image to fit all the characters in them.
Then application shows the same dialog, as with function Resize with found values by default.