internal static double LineHeightForFontSize(this FontMetrics metric, double fontSize) { //return lineHeightToFontSizeRatio * fontSize; var result = metric.CapHeightForFontSize(fontSize) + metric.DescentForFontSize(fontSize); if (Double.IsNaN(result)) System.Diagnostics.Debug.WriteLine(""); return result; }
internal static void DebugMetricsForFontSize(this FontMetrics metric, double fontSize) { System.Diagnostics.Debug.WriteLine("Metrics for FontSize: " + fontSize); System.Diagnostics.Debug.WriteLine("\t Ascent: " + metric.AscentForFontSize(fontSize)); System.Diagnostics.Debug.WriteLine("\t Descent: " + metric.DescentForFontSize(fontSize)); System.Diagnostics.Debug.WriteLine("\t CapHeight: " + metric.CapHeightForFontSize(fontSize)); System.Diagnostics.Debug.WriteLine("\t XHeight: " + metric.XHeightForFontSize(fontSize)); System.Diagnostics.Debug.WriteLine("\t LineGap: " + metric.LineGapForFontSize(fontSize)); System.Diagnostics.Debug.WriteLine("\t LineHeight: " + metric.LineHeightForFontSize(fontSize)); }