Exemplo n.º 1
0
        /// <summary>
        /// Change the font size
        /// </summary>
        /// <param name="newSize">New base font size, in points</param>
        private void SetFontSize(double newSize)
        {
            newSize = Math.Min(40.0, Math.Max(4.0, newSize));
            // Convert the new size from points to Pango units
            int newVal = Convert.ToInt32(newSize * Pango.Scale.PangoScale);

            baseFont.Size = newVal;

            // Iterate through all existing controls, setting the new base font
            if (_mainWidget != null)
            {
                SetWidgetFont(_mainWidget, baseFont);
            }

            // Reset the style machinery to apply the new base font to all
            // newly created Widgets.
            Rc.ReparseAllForSettings(Settings.Default, true);
        }