TeXBreak

References
public sealed class TeXBreak
Represents a potential line break position within a TeXStream.

Constructors

TeXBreak

#
public TeXBreak(TeXBody stream)
Create the initial root in a break sequence.
stream (TeXBody)

TeXBreak

#
public TeXBreak(TeXBreak root, (int i0, int i1) range, double lineWidth, double ratio)
Create a new break.
root (TeXBreak)
range ((int i0, int i1))
lineWidth (double)
ratio (double)

Properties

Aleph0GlueCount

#
public int Aleph0GlueCount { get; }
Gets the number of glue elements with Aleph0 level infinite stretchability.

Aleph1GlueCount

#
public int Aleph1GlueCount { get; }
Gets the number of glue elements with Aleph1 level infinite stretchability.

Boxes

#
public IEnumerable<TeXBox> Boxes { get; }
Enumerate over all TeX boxes on this line.

BreakSequence

#
public IEnumerable<TeXBreak> BreakSequence { get; }
Enumerate over all the breaks leading up to this one, starting with the oldest.

CumulativeBoxWidth

#
public double CumulativeBoxWidth { get; }
Gets the cumulative width of all boxes on this line.

CumulativeGlueWidth

#
public double CumulativeGlueWidth { get; }
Gets the cumulative ideal width of all glue on this line.

Elements

#
public IEnumerable<ITeXElement> Elements { get; }
Enumerate over all TeX elements on this line.

Glue

#
public IEnumerable<TeXGlue> Glue { get; }
Enumerate over all TeX glue on this line.

IdealWidth

#
public double IdealWidth { get; }
Gets the ideal width of this line if all glue were to remain unmolested.

Index0

#
public int Index0 { get; }
Gets the index of the first TeX element on this break line.

Index1

#
public int Index1 { get; }
Gets the index of the last TeX element on this break line.

LineIndex

#
public int LineIndex { get; }
Gets the line index this break represents.

LineWidth

#
public double LineWidth { get; }
Gets the line width this break is associated with.

LocalDemerits

#
public long LocalDemerits { get; }
Gets the demerits associated with this particular break.

MaximumGlueWidth

#
public double MaximumGlueWidth { get; }
Gets the cumulative maximum width of all glue on this line.

MaximumWidth

#
public double MaximumWidth { get; }
Gets the maximum width of this line if all glue were to be stretched as far as it allows itself to be stretched.

MinimumGlueWidth

#
public double MinimumGlueWidth { get; }
Gets the cumulative minimum width of all glue on this line.

MinimumWidth

#
public double MinimumWidth { get; }
Gets the minimum width of this line if all glue were to be shrunk as far as it allows itself to be shrunk.

Overfull

#
public bool Overfull { get; }
Geta whether this line is overfull, i.e. whether it contains too many items and not enough shrinkability to fit within the target width.

ParagraphIndex

#
public int ParagraphIndex { get; }
Gets the paragraph index this break is associated with.

Penalties

#
public IEnumerable<TeXPenalty> Penalties { get; }
Enumerate over all TeX penalties on this line.

PenaltyWidth

#
public double PenaltyWidth { get; }
Gets the added width due to an ending penalty.

Root

#
public TeXBreak Root { get; }
Gets the root break (if any) of this break.

Stream

#
public TeXBody Stream { get; }
Gets the TeX stream associated with this break.

StretchCategory

#
public LineStretchClass StretchCategory { get; }
Gets the shrinkage/stretching category associated with the line leading up to this break.

StretchRatio

#
public double StretchRatio { get; }
Gets the glue adjustment ratio for the line leading up to this break.

TotalDemerits

#
public long TotalDemerits { get; }
Gets the accumulated demerits for the entire break hierarchy up to this break.

UnderFull

#
public bool UnderFull { get; }
Gets whether this line is underfull, i.e. whether it contains insufficient items and not enough stretchability to fit within the target width.

Methods

BoxesAndOffsets

#
public IEnumerable<(TeXBox box, double offset)> BoxesAndOffsets(bool allowStretching, bool allowStretchingPastMaximum)
Position all boxes on this line.
allowStretching (bool)If true, lines will be stretched so they are right-justified.
allowStretchingPastMaximum (bool)If true, lines are allowed to be stretched past their maximum.
An enumeration of tuples with the relevant box and the horizontal offset for each.

RenderLines

#
public void RenderLines(Context context, PointF anchor, TeXLayout layout, Action<Context, TeXBox, RectangleF> customPainter = null)
Render a set of lines as defined by a break sequence.
context (Context)Graphics context.
anchor (PointF)Anchor for first line.
layout (TeXLayout)Spacing settings.
customPainter (Action<Context, TeXBox, RectangleF> = null)Optional painter for empty boxes.

ToString

#
public override string ToString()
Object.ToString

ToTeXCache

#
public TeXCache ToTeXCache(PointF anchor, TeXLayout layout)
Cache the location of all the layout boxes. This is the best way of storing typeset glyphs for fast drawing.
anchor (PointF)
layout (TeXLayout)
An array of boxes in no particular order to be drawn.