Ejemplo n.º 1
0
 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)
 {
 }
Ejemplo n.º 2
0
        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));
        }
Ejemplo n.º 3
0
 public void AppendAttributedString(AttributedString <TFont, TGlyph> other)
 {
     _runs.AddRange(other.Runs);
     FuseMatchingRuns();
 }