TheDrawFont Class
Definition
Section titled “Definition”Represents a TheDraw ascii font. http://www.roysac.com/thedrawfonts-tdf.html
public class TheDrawFontInheritance object
Constructors
Section titled “Constructors”TheDrawFont()
Section titled “TheDrawFont()”public TheDrawFont()Properties
Section titled “Properties”The title of the font.
public string Title { get; set; }The type of font.
public TheDrawFont.FontType Type { get; set; }LetterSpacing
Section titled “LetterSpacing”The empty characters between letters when drawing.
public int LetterSpacing { get; set; }CharactersSupported
Section titled “CharactersSupported”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.
public bool[] CharactersSupported { get; set; }Methods
Section titled “Methods”IsCharacterSupported(int)
Section titled “IsCharacterSupported(int)”Returns true when the specified character glyph is supported by this font; otherwise false.
public bool IsCharacterSupported(int glyph)Parameters
Section titled “Parameters”glyph int
Returns
Section titled “Returns”bool
A boolean value indicating whether or not the specified glyph is supported.
GetCharacter(int)
Section titled “GetCharacter(int)”Gets a character from this font by character code.
public TheDrawFont.Character GetCharacter(int glyph)Parameters
Section titled “Parameters”glyph int
The character to get.
Returns
Section titled “Returns”TheDrawFont.Character
The specified character.
Exceptions
Section titled “Exceptions”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.
GetSurface(int)
Section titled “GetSurface(int)”Generates a surface from the specified glyph using a white foreground and black background for the individual glyphs of the character.
public CellSurface? GetSurface(int glyph)Parameters
Section titled “Parameters”glyph int
The glyph index.
Returns
Section titled “Returns”CellSurface
A surface of just the glyph. Width and height of the surface is based on the TheDraw’s font.
GetSurface(int, Color, Color)
Section titled “GetSurface(int, Color, Color)”Generates a surface from the specified glyph using the specified foreground and background for the individual glyphs of the character.
public CellSurface? GetSurface(int glyph, Color alternateForeground, Color alternateBackground)Parameters
Section titled “Parameters”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.
Returns
Section titled “Returns”CellSurface
A surface of just the glyph. Width and height of the surface is based on the TheDraw’s font.
ReadFonts(string)
Section titled “ReadFonts(string)”Returns a collection of fonts from a TheDraw font file.
public static IEnumerable<TheDrawFont> ReadFonts(string file)Parameters
Section titled “Parameters”file string
The file to read.
Returns
Section titled “Returns”IEnumerable<TheDrawFont>
A collection of TheDraw fonts.