/// <summary> /// </summary> public static XSize MeasureStringWpf(string text, XFont font, XStringFormat stringFormat) { FormattedText formattedText = FontHelper.CreateFormattedText(text, font.typeface, font.Size, System.Windows.Media.Brushes.Black); XSize wpfSize = new XSize(formattedText.WidthIncludingTrailingWhitespace, formattedText.Height); return(wpfSize); }