public TextLineDisplay( AttributedString <TFont, TGlyph> text, Range range, TypesettingContext <TFont, TGlyph> context, List <IMathAtom> atoms) : this( text.Runs.Select( run => new TextRunDisplay <TFont, TGlyph>(run, new Range(range.Location, run.Length), context) ).ToList(), atoms) { }
public static TextLineDisplay <TFont, TGlyph> Create <TFont, TGlyph>( AttributedString <TFont, TGlyph> text, Range range, TypesettingContext <TFont, TGlyph> context, IEnumerable <IMathAtom> atoms ) where TFont : MathFont <TGlyph> { int index = range.Location; List <TextRunDisplay <TFont, TGlyph> > textRuns = new List <TextRunDisplay <TFont, TGlyph> >(); foreach (var run in text.Runs) { var innerRange = new Range(index, run.Length); var textRun = new TextRunDisplay <TFont, TGlyph>( run, innerRange, context ); textRuns.Add(textRun); } return(new TextLineDisplay <TFont, TGlyph>(textRuns, atoms)); }
public void AppendAttributedString(AttributedString <TFont, TGlyph> other) { _runs.AddRange(other.Runs); FuseMatchingRuns(); }