FontConfig Class
Definition
Section titled “Definition”The config settings for loading the default fonts when the game starts.
public class FontConfig : IConfiguratorInheritance object
Implements IConfigurator
Constructors
Section titled “Constructors”FontConfig()
Section titled “FontConfig()”public FontConfig()Fields
Section titled “Fields”CustomFonts
Section titled “CustomFonts”An array of custom font files to load into SadConsole. The default is an empty array.
public string[] CustomFontsAlternativeDefaultFont
Section titled “AlternativeDefaultFont”The default font to use when the game starts. A null value indicates that the default font is the built-in font.
public string? AlternativeDefaultFontUseExtendedFont
Section titled “UseExtendedFont”When true, the default font is the SadConsole extended font. The default is false.
public bool UseExtendedFontDefaultFontSize
Section titled “DefaultFontSize”The size of font to use with the default font. The default is One.
public IFont.Sizes DefaultFontSizeProperties
Section titled “Properties”FontLoader
Section titled “FontLoader”The method invoked by the GameHost as fonts are loaded.
public Action<FontConfig, GameHost>? FontLoader { get; set; }Methods
Section titled “Methods”UseBuiltinFont()
Section titled “UseBuiltinFont()”Sets the default font to the SadConsole standard font, an IBM 8x16 font.
public void UseBuiltinFont()UseBuiltinFontExtended()
Section titled “UseBuiltinFontExtended()”Sets the default font to the SadConsole extended font, an IBM 8x16 font with SadConsole specific characters past index 255.
public void UseBuiltinFontExtended()UseCustomFont(string)
Section titled “UseCustomFont(string)”Sets the default font in SadConsole to the specified font file.
public void UseCustomFont(string fontFile)Parameters
Section titled “Parameters”fontFile string
AddExtraFonts(params string[])
Section titled “AddExtraFonts(params string[])”Loads the provided font files into SadConsole.
public void AddExtraFonts(params string[] fontFiles)Parameters
Section titled “Parameters”fontFiles string[]
An array of font files to load.
SetDefaultFontSize(Sizes)
Section titled “SetDefaultFontSize(Sizes)”Sets the default font size for the game. The default is One.
public void SetDefaultFontSize(IFont.Sizes size)Parameters
Section titled “Parameters”size IFont.Sizes
The default font size.
Run(BuilderBase, GameHost)
Section titled “Run(BuilderBase, GameHost)”Invokes the FontLoader delegate.
public void Run(BuilderBase config, GameHost game)Parameters
Section titled “Parameters”config BuilderBase
The builder running this configurator.
game GameHost
The game being created.