SIL.FieldWorks.SharpViews.AssembledStyles.ApplyCharacterStyleInfo C# (CSharp) Method

ApplyCharacterStyleInfo() private method

private ApplyCharacterStyleInfo ( ICharacterStyleInfo fontInfo ) : void
fontInfo ICharacterStyleInfo
return void
		private void ApplyCharacterStyleInfo(ICharacterStyleInfo fontInfo)
		{
			if (fontInfo == null)
				return;
			if (fontInfo.Bold != null && fontInfo.Bold.ValueIsSet)
				FontWeight = fontInfo.Bold.Value ? (int) VwFontWeight.kvfwBold : (int) VwFontWeight.kvfwNormal;
			if (fontInfo.FontSize != null && fontInfo.FontSize.ValueIsSet)
				m_chrp.dympHeight = fontInfo.FontSize.Value;
			if (fontInfo.BackColor != null && fontInfo.BackColor.ValueIsSet)
				m_chrp.clrBack = ColorUtil.ConvertColorToBGR(fontInfo.BackColor.Value);
			if (fontInfo.FontColor != null && fontInfo.FontColor.ValueIsSet)
				m_chrp.clrFore = ColorUtil.ConvertColorToBGR(fontInfo.FontColor.Value);
			if (fontInfo.Italic != null && fontInfo.Italic.ValueIsSet)
				m_chrp.ttvItalic = fontInfo.Italic.Value ? (int)FwTextToggleVal.kttvForceOn : (int)FwTextToggleVal.kttvOff;
			if (fontInfo.Offset != null && fontInfo.Offset.ValueIsSet)
				m_chrp.dympOffset = fontInfo.Offset.Value;
			if (fontInfo.UnderlineColor != null && fontInfo.UnderlineColor.ValueIsSet)
				m_chrp.clrUnder = ColorUtil.ConvertColorToBGR(fontInfo.UnderlineColor.Value);
			if (fontInfo.FontName != null && fontInfo.FontName.ValueIsSet && fontInfo.FontName.Value != null)
				SetFaceName(fontInfo.FontName.Value);
			if (fontInfo.Underline != null && fontInfo.Underline.ValueIsSet)
				m_chrp.unt = (int)fontInfo.Underline.Value;
			// Todo: supersub, font features
		}