Esempio n. 1
0
        private void Segoe_UI_Symbol_Loaded(object sender, RoutedEventArgs e)
        {
            // FontFamily ff = new FontFamily("Segoe MDL2 Assets");

            if (CurrentFontFamily != null)
            {
                this.FontFamily = CurrentFontFamily;
                _fontFamily     = CurrentFontFamily;

                this.Title = " 当前字体 : " + CurrentFontFamily.Source;

                listBox.ItemsSource = FontItem.EnumeratorFontFamily(CurrentFontFamily);
            }

            fontDispaly.FontFamily = CurrentFontFamily;
        }
Esempio n. 2
0
        private void SetFont()
        {
            double fontSize;

            double.TryParse(fontSizeInput.Text, out fontSize);
            _fontSize = fontSize == 0d ? 16 : fontSize;

            if (fontColorInput.SelectedIndex == 0)
            {
                _foreground = new SolidColorBrush(Colors.Black);
            }
            else
            {
                _foreground = new SolidColorBrush(Colors.White);
            }

            _fontText = FontItem.ByteStringToString(fontInput.Text);
        }