public GenericTextRunProperties(FontRendering newRender)
 {
     _typeface          = newRender.Typeface;
     _emSize            = newRender.FontSize;
     _emHintingSize     = newRender.FontSize;
     _textDecorations   = newRender.TextDecorations;
     _foregroundBrush   = newRender.TextColor;
     _backgroundBrush   = null;
     _baselineAlignment = BaselineAlignment.Baseline;
     _culture           = CultureInfo.CurrentUICulture;
 }
 public GenericTextParagraphProperties(FontRendering newRendering)
 {
     _flowDirection = FlowDirection.LeftToRight;
      _textAlignment = newRendering.TextAlignment;
      _firstLineInParagraph = false;
      _alwaysCollapsible = false;
      _defaultTextRunProperties = new GenericTextRunProperties(
     newRendering.Typeface, newRendering.FontSize, newRendering.FontSize,
     newRendering.TextDecorations, newRendering.TextColor, null,
     BaselineAlignment.Baseline, CultureInfo.CurrentUICulture);
      _textWrap = TextWrapping.Wrap;
      _lineHeight = 0;
      _indent = 0;
      _paragraphIndent = 0;
 }
 public GenericTextParagraphProperties(FontRendering newRendering)
 {
     _flowDirection            = FlowDirection.LeftToRight;
     _textAlignment            = newRendering.TextAlignment;
     _firstLineInParagraph     = false;
     _alwaysCollapsible        = false;
     _defaultTextRunProperties = new GenericTextRunProperties(
         newRendering.Typeface, newRendering.FontSize, newRendering.FontSize,
         newRendering.TextDecorations, newRendering.TextColor, null,
         BaselineAlignment.Baseline, CultureInfo.CurrentUICulture);
     _textWrap        = TextWrapping.Wrap;
     _lineHeight      = 0;
     _indent          = 0;
     _paragraphIndent = 0;
 }
示例#4
0
        private void WindowLoaded(object sender, EventArgs e)
        {
            // Enumerate the fonts and add them to the font family combobox.
            foreach (System.Windows.Media.FontFamily fontFamily in Fonts.SystemFontFamilies)
            {
                fontFamilyCB.Items.Add(fontFamily.Source);
            }
            fontFamilyCB.SelectedIndex = 7;

            // Load the font size combo box with common font sizes.
            for (int i = 0; i < CommonFontSizes.Length; i++)
            {
                fontSizeCB.Items.Add(CommonFontSizes[i]);
            }
            fontSizeCB.SelectedIndex = 21;

            //Load capitals combo box
            typographyMenuBar.Visibility = Visibility.Collapsed;

            //Set up the initial render state of the drawn text.
            if (_currentRendering == null)
            {
                _currentRendering = new FontRendering(
                    (double)fontSizeCB.SelectedItem,
                    TextAlignment.Left,
                    null,
                    System.Windows.Media.Brushes.Black,
                    new Typeface("Arial"));
            }

            // Initialize the text store.
            if (_textStore == null)
            {
                _textStore = new CustomTextSource();
            }

            _UILoaded = true; //All UI is loaded, can handle events now
            UpdateFormattedText();
        }
 public GenericTextRunProperties(FontRendering newRender)
 {
     _typeface = newRender.Typeface;
      _emSize = newRender.FontSize;
      _emHintingSize = newRender.FontSize;
      _textDecorations = newRender.TextDecorations;
      _foregroundBrush = newRender.TextColor;
      _backgroundBrush = null;
      _baselineAlignment = BaselineAlignment.Baseline;
      _culture = CultureInfo.CurrentUICulture;
 }
        private void WindowLoaded(object sender, EventArgs e)
        {
            // Enumerate the fonts and add them to the font family combobox.
             foreach (System.Windows.Media.FontFamily fontFamily in Fonts.SystemFontFamilies)
             {
            fontFamilyCB.Items.Add(fontFamily.Source);
             }
             fontFamilyCB.SelectedIndex = 7;

             // Load the font size combo box with common font sizes.
             for (int i=0; i < CommonFontSizes.Length; i++)
             {
            fontSizeCB.Items.Add(CommonFontSizes[i]);
             }
             fontSizeCB.SelectedIndex = 21;

             //Load capitals combo box
             typographyMenuBar.Visibility = Visibility.Collapsed;

             //Set up the initial render state of the drawn text.
             if (_currentRendering == null)
             {
            _currentRendering = new FontRendering(
               (double)fontSizeCB.SelectedItem,
               TextAlignment.Left,
               null,
               System.Windows.Media.Brushes.Black,
               new Typeface("Arial"));
             }

             // Initialize the text store.
             if (_textStore == null)
            _textStore = new CustomTextSource();

             _UILoaded = true;    //All UI is loaded, can handle events now
             UpdateFormattedText();
        }