コード例 #1
0
        /// <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;
        }
コード例 #2
0
 public void SetFontInfo(
     FontInfo fontInfo)
 {
     this.fontInfo = fontInfo;
 }
コード例 #3
0
 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;
     }
 }
コード例 #4
0
        private void OKBUtton_Click(object sender, RoutedEventArgs e)
        {
            this.fontInfo = this.PreviewTextBlock.GetFontInfo();

            this.DialogResult = true;
            this.Close();
        }