/// <summary> /// FontInfoに変換する /// </summary> /// <param name="font">Font</param> /// <returns>FontInfo</returns> public static FontInfo ToFontInfo( this System.Drawing.Font font) { var fi = new FontInfo() { Family = font.ToFontFamilyWPF(), Size = font.ToFontSizeWPF(), Style = font.ToFontStyleWPF(), Weight = font.ToFontWeightWPF(), Stretch = System.Windows.FontStretches.Normal }; return fi; }
public void SetFontInfo( FontInfo fontInfo) { this.fontInfo = fontInfo; }
internal static void SetFontInfo( this TextBlock control, FontInfo fontInfo) { if (control.GetFontInfo().ToString() != fontInfo.ToString()) { control.FontFamily = fontInfo.Family; control.FontSize = fontInfo.Size; control.FontStyle = fontInfo.Style; control.FontWeight = fontInfo.Weight; control.FontStretch = fontInfo.Stretch; } }
private void OKBUtton_Click(object sender, RoutedEventArgs e) { this.fontInfo = this.PreviewTextBlock.GetFontInfo(); this.DialogResult = true; this.Close(); }