Measure Text Faster Using GDI

It is used to store an array of integers (depending upon the number of a characters in the index) ranging 0 to 255 starting from a Dictionary of various font (if any font sent to the method does not exist). Testing proves it to take approximately 60ms. Other characters that are above 255 (unicode) are then measured as a fly and are then stored in the array as needed. All measurements are then called through a public static method named as MeasureStringWidth(). In the loop it will greatly enhance the processing speed by 30-40% if not more. Can measure italic and mono fonts. Just copy this free software project and enjoy.

Leave a Comment

Your email address will not be published.