Example #1
0
		public IEnumerable<TextLine> Format(string text, IChatSpanProvider spans, double width, Brush foreground, Brush background,
			TextWrapping textWrapping)
		{
			_text = text;
			_spans = spans;
			_background = background;
			_runProperties = new CustomTextRunProperties(_runProperties.Typeface, _runProperties.FontRenderingEmSize, foreground,
				Brushes.Transparent, false);
			_paraProperties = new CustomParagraphProperties(_runProperties);
			if (width < 0)
			{
				width = 0;
				text = "";
			}

			int idx = 0;
			while(idx < _text.Length)
			{
				var line = _formatter.FormatLine(this, idx, width, _paraProperties, null);
				idx += line.Length;
				yield return line;
			}
		}
Example #2
0
        public IEnumerable <TextLine> Format(string text, IChatSpanProvider spans, double width, Brush foreground, Brush background,
                                             TextWrapping textWrapping)
        {
            _text          = text;
            _spans         = spans;
            _background    = background;
            _runProperties = new CustomTextRunProperties(_runProperties.Typeface, _runProperties.FontRenderingEmSize, foreground,
                                                         Brushes.Transparent, false);
            _paraProperties = new CustomParagraphProperties(_runProperties);
            if (width < 0)
            {
                width = 0;
                text  = "";
            }

            int idx = 0;

            while (idx < _text.Length)
            {
                var line = _formatter.FormatLine(this, idx, width, _paraProperties, null);
                idx += line.Length;
                yield return(line);
            }
        }