If WPF works for you (I see that someone just removed the WPF tag for this question, but it was there initially), there is also FormattedText :
FormattedText formattedText = new FormattedText("hello foo", CultureInfo.GetCultureInfo("en-us"), FlowDirection.LeftToRight, new Typeface("Arial"), FontSize = 14, Brushes.Black); double width = formattedText.Width;
Brokenglass
source share