iTextSharp.text.pdf.PushbuttonField.CalculateFontSize C# (CSharp) Метод

CalculateFontSize() приватный Метод

private CalculateFontSize ( float w, float h ) : float
w float
h float
Результат float
        private float CalculateFontSize(float w, float h) {
            BaseFont ufont = RealFont;
            float fsize = fontSize;
            if (fsize == 0) {
                float bw = ufont.GetWidthPoint(text, 1);
                if (bw == 0)
                    fsize = 12;
                else
                    fsize = w / bw;
                float nfsize = h / (1 - ufont.GetFontDescriptor(BaseFont.DESCENT, 1));
                fsize = Math.Min(fsize, nfsize);
                if (fsize < 4)
                    fsize = 4;
            }
            return fsize;
        }