Bloom.Workspace.WorkspaceView.ShortenStringToFit C# (CSharp) Method

ShortenStringToFit() public static method

Ensure that the TabStripItem or Control or Whatever is no wider than desired by truncating the Text as needed, with an ellipsis appended to show truncation has occurred.
Would this be a good library method somewhere? Where?
public static ShortenStringToFit ( string text, int maxWidth, int originalWidth, Font font, Graphics g ) : string
text string the string to shorten if necessary
maxWidth int the maximum item width allowed
originalWidth int the original item width (with the original string)
font System.Drawing.Font the font to use
g System.Drawing.Graphics the relevant Graphics object for drawing/measuring
return string
        public static string ShortenStringToFit(string text, int maxWidth, int originalWidth, Font font, Graphics g)
        {
            const string kEllipsis = "\u2026";
            var txtWidth = g.MeasureString(text, font).Width;
            var padding = originalWidth - txtWidth;
            while (txtWidth + padding > maxWidth)
            {
                var len = text.Length - 2;
                if (len <= 0)
                    break;	// I can't conceive this happening, but I'm also paranoid.
                text = text.Substring(0, len) + kEllipsis;	// trim, add ellipsis
                txtWidth = g.MeasureString(text, font).Width;
            }
            return text;
        }