public GenericTextRunProperties(FontRendering newRender) { _typeface = newRender.Typeface; _emSize = newRender.FontSize; _emHintingSize = newRender.FontSize; _textDecorations = newRender.TextDecorations; _foregroundBrush = newRender.ForegroundBrush; _backgroundBrush = newRender.BackgroundBrush; _baselineAlignment = BaselineAlignment.Baseline; _textEffects = newRender.TextEffects; _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.ForegroundBrush, newRendering.BackgroundBrush, BaselineAlignment.Baseline, newRendering.TextEffects, CultureInfo.CurrentUICulture); _textWrap = TextWrapping.Wrap; _lineHeight = 0; _indent = 0; _paragraphIndent = 0; }
private Geometry BuildTextGeometry() { var paragraphProperty = new FontRendering( 48, TextAlignment.Left, null, new Typeface(TextSource.FontFamily.Source), Brushes.Black, Brushes.Transparent, new TextEffectCollection()); FormattedText formattedText = new FormattedText( TextSource.Text, CultureInfo.CurrentUICulture, FlowDirection.LeftToRight, paragraphProperty.Typeface, 1.0, Brushes.Transparent ); return formattedText.BuildGeometry(new Point()); }
private void OnLoaded(object sender, RoutedEventArgs routedEventArgs) { if (_paragraphProperty == null) { _paragraphProperty = new FontRendering( 48, TextAlignment.Left, null, new Typeface("Arial"), Brushes.Black, Brushes.Transparent, new TextEffectCollection()); } // Initialize the text store. if (_textSource == null) _textSource = new CustomTextSource(); _uiLoaded = true; //All UI is loaded, can handle events now UpdateText(); }