Skip to content

Class FigletFont

A FIGfont (.flf): a set of glyphs drawn in rows of characters, and the layout its header asks for. Parse one from text or load it from a stream; DarkEffekt.Terminal.FigletText renders with it. A font never changes once parsed.

Declaration
public sealed class FigletFont

The rows in every glyph.

Declaration
public int Height { get; }

The rows from the top of a glyph down to and including the baseline.

Declaration
public int Baseline { get; }

The header’s longest line in the file, endmarks included.

Declaration
public int MaxLength { get; }

The character that stands for a blank other glyphs stop against. It prints as a space.

Declaration
public char Hardblank { get; }

The header’s Old_Layout field: negative for full width, 0 for fitting, or the bits of smushing rules 1 to 5.

Declaration
public int OldLayout { get; }

The layout in effect: the header’s Full_Layout, or the same thing worked out from Old_Layout.

Declaration
public FigletLayout Layout { get; }

The direction the font asks for.

Declaration
public FigletDirection Direction { get; }

The header’s count of code-tagged glyphs, or 0 when it gives none.

Declaration
public int CodetagCount { get; }

The comment block that follows the header, one line per row.

Declaration
public string Comment { get; }

What the parser passed over to read a damaged font the way figlet does: glyphs the end of the file cut short, which take blank rows, and lines after the last glyph that are not a character code. Empty for a sound font.

Declaration
public IReadOnlyList<string> Warnings { get; }

The number of glyphs in the font.

Declaration
public int GlyphCount { get; }

The code points the font has glyphs for, in no set order.

Declaration
public IEnumerable<int> CodePoints { get; }

True when the font has a glyph for a code point.

Declaration
public bool HasGlyph(int codePoint)

System.Boolean

Type Name
System.Int32 codePoint

TryGetGlyph(int, out IReadOnlyList<string>)

Section titled “TryGetGlyph(int, out IReadOnlyList<string>)”

The rows of one glyph, endmarks removed and hardblanks in place. Every row has the same length. False when the font has no such glyph.

Declaration
public bool TryGetGlyph(int codePoint, out IReadOnlyList<string> rows)

System.Boolean

Type Name
System.Int32 codePoint
System.Collections.Generic.IReadOnlyList<System.String> rows

Reads a font from a stream of bytes. The text is taken as UTF-8 when it is valid UTF-8, and as Latin-1 otherwise.

Declaration
public static FigletFont Load(Stream stream)

DarkEffekt.Terminal.FigletFont

Type Name
System.IO.Stream stream

System.FormatException
The data is not a FIGfont, or is a zip-compressed one.

Reads a font from a text reader, to its end.

Declaration
public static FigletFont Load(TextReader reader)

DarkEffekt.Terminal.FigletFont

Type Name
System.IO.TextReader reader

System.FormatException
The text is not a FIGfont.

Parses the text of a .flf file.

Declaration
public static FigletFont Parse(string text)

DarkEffekt.Terminal.FigletFont

Type Name
System.String text

System.FormatException
The text is not a FIGfont.