Skip to content

TheDrawFont Class

Represents a TheDraw ascii font. http://www.roysac.com/thedrawfonts-tdf.html

C#
public class TheDrawFont

Inheritance object

C#
public TheDrawFont()

The title of the font.

C#
public string Title { get; set; }

The type of font.

C#
public TheDrawFont.FontType Type { get; set; }

The empty characters between letters when drawing.

C#
public int LetterSpacing { get; set; }

An array indexed by character code, indicating if a glyph character is supported by the font. Characters 33 to 126 are supported, starting at index 0.

C#
public bool[] CharactersSupported { get; set; }

Returns true when the specified character glyph is supported by this font; otherwise false.

C#
public bool IsCharacterSupported(int glyph)

glyph int

bool
A boolean value indicating whether or not the specified glyph is supported.

Gets a character from this font by character code.

C#
public TheDrawFont.Character GetCharacter(int glyph)

glyph int
The character to get.

TheDrawFont.Character
The specified character.

InvalidOperationException
The character glyph index is valid but isn’t included in this font.

IndexOutOfRangeException
The character glyph index isn’t in range. It must be between 33 and 126.

Generates a surface from the specified glyph using a white foreground and black background for the individual glyphs of the character.

C#
public CellSurface? GetSurface(int glyph)

glyph int
The glyph index.

CellSurface
A surface of just the glyph. Width and height of the surface is based on the TheDraw’s font.

Generates a surface from the specified glyph using the specified foreground and background for the individual glyphs of the character.

C#
public CellSurface? GetSurface(int glyph, Color alternateForeground, Color alternateBackground)

glyph int
The glyph index.

alternateForeground SadRogue.Primitives.Color
Foreground color used to draw the glyph.

alternateBackground SadRogue.Primitives.Color
Background color used to draw the glyph.

CellSurface
A surface of just the glyph. Width and height of the surface is based on the TheDraw’s font.

Returns a collection of fonts from a TheDraw font file.

C#
public static IEnumerable<TheDrawFont> ReadFonts(string file)

file string
The file to read.

IEnumerable<TheDrawFont>
A collection of TheDraw fonts.