Пример #1
0
 public TextLayout(string s, FontFamily font, double fontSize, Brush fore, double width, TextAlignment align = TextAlignment.Left, TextWrapping wrap = TextWrapping.Wrap)
 {
     this.fontRender                      = new FontRendering(font, fontSize, fore, align);
     this.textSource                      = new CustomTextSource();
     this.textSource.Text                 = s;
     this.textSource.FontRendering        = fontRender;
     this.textSource.EffectCollection     = new TextEffectCollection();
     this.textSource.DecorationCollection = new List <TextDecorationInfo>();
     this.TextWarpping                    = wrap;
     this._width   = width;
     this.Disposed = false;
 }
 public GenericTextParagraphProperties(FontRendering newRendering, FlowDirection flow, TextWrapping wrap)
 {
     _flowDirection            = flow;
     _textAlignment            = newRendering.TextAlignment;
     _firstLineInParagraph     = false;
     _alwaysCollapsible        = false;
     _defaultTextRunProperties = new GenericTextRunProperties(
         newRendering.Typeface, newRendering.FontSize, newRendering.FontSize,
         null, newRendering.TextColor, null,
         BaselineAlignment.Baseline, CultureInfo.CurrentUICulture);
     _textWrap        = wrap;
     _lineHeight      = 0;
     _indent          = 0;
     _paragraphIndent = 0;
 }
 public GenericTextRunProperties(FontRendering newRender, TextEffectCollection effects, TextDecorationCollection decorations = null)
 {
     _typeface          = newRender.Typeface;
     _emSize            = newRender.FontSize;
     _emHintingSize     = newRender.FontSize;
     _textDecorations   = decorations;
     _foregroundBrush   = newRender.TextColor;
     _backgroundBrush   = null;
     _baselineAlignment = BaselineAlignment.Baseline;
     _culture           = CultureInfo.CurrentUICulture;
     _effects           = effects;
     if (_textDecorations == null)
     {
         _textDecorations = new TextDecorationCollection();
     }
 }