Ejemplo n.º 1
0
 private LineBreaking.IUnjustifiedLine<Printing.IPrintableLine> CreateLine(LineBreaking.ILineConstraint constraint, StartOfParagraph from, IInterletter to, InlineStyle style, out InlineStyle newStyle)
 {
     var toIndex = Array.IndexOf(_objectList, to);
     if (toIndex == -1) throw new ArgumentException("to");
     return InlineLayoutEngine.Solve(constraint, from.Glue, _objectList.Take(toIndex), to.GlueBeforeBreak, PenaltyValue(to), _heading, style, out newStyle);
 }
Ejemplo n.º 2
0
        private LineBreaking.IUnjustifiedLine <Printing.IPrintableLine> CreateLine(LineBreaking.ILineConstraint constraint, IInterletter from, IInterletter to, InlineStyle style, out InlineStyle newStyle)
        {
            var fromIndex = Array.IndexOf(_objectList, from);

            if (fromIndex == -1)
            {
                throw new ArgumentException("from");
            }
            var toIndex = Array.IndexOf(_objectList, to);

            if (toIndex == -1)
            {
                throw new ArgumentException("to");
            }
            return(InlineLayoutEngine.Solve(
                       constraint,
                       new GlueProperty(from.IndentAfterBreak, 0, 0),
                       _objectList.Skip(fromIndex + 1).Take(toIndex - fromIndex - 1), to.GlueBeforeBreak, PenaltyValue(to), _heading, style, out newStyle));
        }
Ejemplo n.º 3
0
 private LineBreaking.IUnjustifiedLine<Printing.IPrintableLine> CreateLine(LineBreaking.ILineConstraint constraint, IInterletter from, EndOfParagraph to, InlineStyle style, out InlineStyle newStyle)
 {
     var fromIndex = Array.IndexOf(_objectList, from);
     if (fromIndex == -1) throw new ArgumentException("from");
     return InlineLayoutEngine.Solve(
         constraint,
         new GlueProperty(from.IndentAfterBreak, 0, 0),
         _objectList.Skip(fromIndex + 1), to.Glue, PenaltyValue(to), _heading, style, out newStyle);
 }
Ejemplo n.º 4
0
        private LineBreaking.IUnjustifiedLine <Printing.IPrintableLine> CreateLine(LineBreaking.ILineConstraint constraint, StartOfParagraph from, IInterletter to, InlineStyle style, out InlineStyle newStyle)
        {
            var toIndex = Array.IndexOf(_objectList, to);

            if (toIndex == -1)
            {
                throw new ArgumentException("to");
            }
            return(InlineLayoutEngine.Solve(constraint, from.Glue, _objectList.Take(toIndex), to.GlueBeforeBreak, PenaltyValue(to), _heading, style, out newStyle));
        }