PdfRpt.VectorCharts.PieChart.getMaxTextHeight C# (CSharp) Method

getMaxTextHeight() private method

private getMaxTextHeight ( ) : float
return float
        private float getMaxTextHeight()
        {
            var segment = Segments.OrderByDescending(x => x.Label.Length).First();
            var firstFont = PdfFont.Fonts[0];
            var baseFont = firstFont.BaseFont;
            var ascend = baseFont.GetAscentPoint(segment.Label, PdfFont.Size);
            var descend = baseFont.GetDescentPoint(segment.Label, PdfFont.Size);
            var maxTextHeight = ascend - descend;
            if (maxTextHeight.ApproxEquals(0))
            {
                throw new InvalidOperationException("maxTextHeight with " + firstFont.Familyname + " is zero.");
            }
            return maxTextHeight;
        }