ComponentFactory.Krypton.Toolkit.PaletteOffice2013Base.DefineFonts C# (CSharp) Method

DefineFonts() protected method

Update the fonts to reflect system or user defined changes.
protected DefineFonts ( ) : void
return void
        protected override void DefineFonts()
        {
            // Release existing resources
            if (_header1ShortFont != null) _header1ShortFont.Dispose();
            if (_header2ShortFont != null) _header2ShortFont.Dispose();
            if (_headerFormFont != null) _headerFormFont.Dispose();
            if (_header1LongFont != null) _header1LongFont.Dispose();
            if (_header2LongFont != null) _header2LongFont.Dispose();
            if (_buttonFont != null) _buttonFont.Dispose();
            if (_buttonFontNavigatorStack != null) _buttonFontNavigatorStack.Dispose();
            if (_buttonFontNavigatorMini != null) _buttonFontNavigatorMini.Dispose();
            if (_tabFontSelected != null) _tabFontSelected.Dispose();
            if (_tabFontNormal != null) _tabFontNormal.Dispose();
            if (_ribbonTabFont != null) _ribbonTabFont.Dispose();
            if (_ribbonTabContextFont != null) _ribbonTabContextFont.Dispose();
            if (_gridFont != null) _gridFont.Dispose();
            if (_calendarFont != null) _calendarFont.Dispose();
            if (_calendarBoldFont != null) _calendarBoldFont.Dispose();
            if (_superToolFont != null) _superToolFont.Dispose();
            if (_boldFont != null) _boldFont.Dispose();
            if (_italicFont != null) _italicFont.Dispose();

            float baseFontSize = BaseFontSize;
            string baseFontName = BaseFontName;
            _header1ShortFont = new Font(baseFontName, baseFontSize + 4.5f, FontStyle.Bold);
            _header2ShortFont = new Font(baseFontName, baseFontSize, FontStyle.Regular);
            _headerFormFont = new Font(baseFontName, SystemFonts.CaptionFont.SizeInPoints, FontStyle.Regular);
            _header1LongFont = new Font(baseFontName, baseFontSize + 1.5f, FontStyle.Regular);
            _header2LongFont = new Font(baseFontName, baseFontSize, FontStyle.Regular);
            _buttonFont = new Font(baseFontName, baseFontSize, FontStyle.Regular);
            _buttonFontNavigatorStack = new Font(_buttonFont, FontStyle.Bold);
            _buttonFontNavigatorMini = new Font(baseFontName, baseFontSize + 3.0f, FontStyle.Bold);
            _tabFontNormal = new Font(baseFontName, baseFontSize, FontStyle.Regular);
            _tabFontSelected = new Font(_tabFontNormal, FontStyle.Bold);
            _ribbonTabFont = new Font(baseFontName, baseFontSize, FontStyle.Regular);
            _ribbonTabContextFont = new Font(_ribbonTabFont, FontStyle.Bold);
            _gridFont = new Font(baseFontName, baseFontSize, FontStyle.Regular);
            _superToolFont = new Font(baseFontName, baseFontSize, FontStyle.Bold);
            _calendarFont = new Font(baseFontName, baseFontSize, FontStyle.Regular);
            _calendarBoldFont = new Font(baseFontName, baseFontSize, FontStyle.Bold);
            _boldFont = new Font(baseFontName, baseFontSize, FontStyle.Bold);
            _italicFont = new Font(baseFontName, baseFontSize, FontStyle.Italic);
        }
PaletteOffice2013Base