public sealed class TeXBox : ITeXElement
Provides a double-precision implementation of TeX-style line-breaking boxes in accordance with Donald Knuth and Michael Plass' seminal 1981 paper 'Breaking Paragraphs into Lines'.

Constructors

TeXBox

#
public TeXBox()
Create an empty box.

TeXBox

#
public TeXBox(double width, double height, string id = null)
Create an empty box with a specific width.
width (double)Width of box.
height (double)Height of box.
id (string = null)Optional identifier to place in the TEXT of the box.

TeXBox

#
public TeXBox(string text, Font font, Color colour = default(Color))
Create a new box with a word content.
text (string)
font (Font)
colour (Color = null)

Properties

Colour

#
public Color Colour { get; }
Gets the colour associated with this box.

Font

#
public Font Font { get; }
Gets the font associated with this box, can be null.

Height

#
public double Height { get; }
Gets the height of this box.

Text

#
public string Text { get; }
Gets the text associated with this box, can be null.

Type

#
public TeXType Type { get; }
Type

VerticalOffset

#
public float VerticalOffset { get; }
Gets the vertical offset of this box in logical pixel coordinates. The offset isn't applied until the text is drawn.

Width

#
public double Width { get; }
Gets the width of this box.

Methods

Append

#
public TeXBox Append(string text)
text (string)

ToString

#
public override string ToString()
Object.ToString

WithLogicalOffset

#
public TeXBox WithLogicalOffset(float offset)
Assign a vertical offset to this box.
offset (float)Logical pixel offset.

WithTypographicOffset

#
public TeXBox WithTypographicOffset(float offset)
Assign a vertical offset to this box.
offset (float)Typographic offset in font units.