ExampleGallery.BurningTextExample.GetFontSize C# (CSharp) Méthode

GetFontSize() private static méthode

Calculates a good font size so the text will fit even on smaller phone screens.
private static GetFontSize ( Size displaySize ) : float
displaySize Windows.Foundation.Size
Résultat float
        private static float GetFontSize(Size displaySize)
        {
            const float maxFontSize = 72;
            const float scaleFactor = 12;

            return Math.Min((float)displaySize.Width / scaleFactor, maxFontSize);
        }