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.
Assembly: DarkEffekt.Terminal.Core
Section titled “Assembly: DarkEffekt.Terminal.Core”public sealed class FigletFontProperties
Section titled “Properties”Height
Section titled “Height”The rows in every glyph.
public int Height { get; }Baseline
Section titled “Baseline”The rows from the top of a glyph down to and including the baseline.
public int Baseline { get; }MaxLength
Section titled “MaxLength”The header’s longest line in the file, endmarks included.
public int MaxLength { get; }Hardblank
Section titled “Hardblank”The character that stands for a blank other glyphs stop against. It prints as a space.
public char Hardblank { get; }OldLayout
Section titled “OldLayout”The header’s Old_Layout field: negative for full width, 0 for fitting, or the bits of smushing rules 1 to 5.
public int OldLayout { get; }Layout
Section titled “Layout”The layout in effect: the header’s Full_Layout, or the same thing worked out from Old_Layout.
public FigletLayout Layout { get; }Direction
Section titled “Direction”The direction the font asks for.
public FigletDirection Direction { get; }CodetagCount
Section titled “CodetagCount”The header’s count of code-tagged glyphs, or 0 when it gives none.
public int CodetagCount { get; }Comment
Section titled “Comment”The comment block that follows the header, one line per row.
public string Comment { get; }Warnings
Section titled “Warnings”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.
public IReadOnlyList<string> Warnings { get; }GlyphCount
Section titled “GlyphCount”The number of glyphs in the font.
public int GlyphCount { get; }CodePoints
Section titled “CodePoints”The code points the font has glyphs for, in no set order.
public IEnumerable<int> CodePoints { get; }Methods
Section titled “Methods”HasGlyph(int)
Section titled “HasGlyph(int)”True when the font has a glyph for a code point.
public bool HasGlyph(int codePoint)Returns
Section titled “Returns”System.Boolean
Parameters
Section titled “Parameters”| 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.
public bool TryGetGlyph(int codePoint, out IReadOnlyList<string> rows)Returns
Section titled “Returns”System.Boolean
Parameters
Section titled “Parameters”| Type | Name |
|---|---|
System.Int32 |
codePoint |
System.Collections.Generic.IReadOnlyList<System.String> |
rows |
Load(Stream)
Section titled “Load(Stream)”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.
public static FigletFont Load(Stream stream)Returns
Section titled “Returns”DarkEffekt.Terminal.FigletFont
Parameters
Section titled “Parameters”| Type | Name |
|---|---|
System.IO.Stream |
stream |
Exceptions
Section titled “Exceptions”System.FormatException
The data is not a FIGfont, or is a zip-compressed one.
Load(TextReader)
Section titled “Load(TextReader)”Reads a font from a text reader, to its end.
public static FigletFont Load(TextReader reader)Returns
Section titled “Returns”DarkEffekt.Terminal.FigletFont
Parameters
Section titled “Parameters”| Type | Name |
|---|---|
System.IO.TextReader |
reader |
Exceptions
Section titled “Exceptions”System.FormatException
The text is not a FIGfont.
Parse(string)
Section titled “Parse(string)”Parses the text of a .flf file.
public static FigletFont Parse(string text)Returns
Section titled “Returns”DarkEffekt.Terminal.FigletFont
Parameters
Section titled “Parameters”| Type | Name |
|---|---|
System.String |
text |
Exceptions
Section titled “Exceptions”System.FormatException
The text is not a FIGfont.