Пример #1
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Saves the font info.
        /// </summary>
        /// <param name="fontInfo">The font info.</param>
        /// ------------------------------------------------------------------------------------
        void IFontDialog.SaveFontInfo(FontInfo fontInfo)
        {
            // Font name
            string newValue = FontInfo.GetInternalFontName(m_tbFontName.Text);

            fontInfo.IsDirty |= fontInfo.m_fontName.Save(false, newValue);

            // font size
            int fontSize = FontSize;

            fontInfo.IsDirty |= fontInfo.m_fontSize.Save(false, fontSize * 1000);

            // color
            bool  fIsInherited;
            Color color = m_FontAttributes.GetFontColor(out fIsInherited);

            fontInfo.IsDirty |= fontInfo.m_fontColor.Save(fIsInherited, color);

            // background color
            color             = m_FontAttributes.GetBackgroundColor(out fIsInherited);
            fontInfo.IsDirty |= fontInfo.m_backColor.Save(fIsInherited, color);

            // underline style
            FwUnderlineType underlineType = m_FontAttributes.GetUnderlineType(out fIsInherited);

            fontInfo.IsDirty |= fontInfo.m_underline.Save(fIsInherited, underlineType);

            // underline color
            color             = m_FontAttributes.GetUnderlineColor(out fIsInherited);
            fontInfo.IsDirty |= fontInfo.m_underlineColor.Save(fIsInherited, color);

            // bold, italic, superscript, subscript
            bool fFlag = m_FontAttributes.GetBold(out fIsInherited);

            fontInfo.IsDirty |= fontInfo.m_bold.Save(fIsInherited, fFlag);

            fFlag             = m_FontAttributes.GetItalic(out fIsInherited);
            fontInfo.IsDirty |= fontInfo.m_italic.Save(fIsInherited, fFlag);

            if (m_FontAttributes.AllowSuperSubScript)
            {
                FwSuperscriptVal superSub = m_FontAttributes.GetSubSuperscript(out fIsInherited);
                fontInfo.IsDirty |= fontInfo.m_superSub.Save(fIsInherited, superSub);

                // position
                int fontPos = m_FontAttributes.GetFontPosition(out fIsInherited);
                fontInfo.IsDirty |= fontInfo.m_offset.Save(fIsInherited, fontPos);
            }

            // features
            string fontFeatures = m_FontAttributes.GetFontFeatures(out fIsInherited);

            fontInfo.IsDirty |= fontInfo.m_features.Save(fIsInherited, fontFeatures);
        }