Class FontConfig
The config settings for loading the default fonts when the game starts.
Implements
Inherited Members
Namespace: SadConsole.Configuration
Assembly: SadConsole.dll
Syntax
public class FontConfig : IConfigurator
Constructors
FontConfig()
Declaration
public FontConfig()
Fields
AlternativeDefaultFont
The default font to use when the game starts. A null value indicates that the default font is the built-in font.
Declaration
public string? AlternativeDefaultFont
Field Value
| Type | Description |
|---|---|
| string |
CustomFonts
An array of custom font files to load into SadConsole. The default is an empty array.
Declaration
public string[] CustomFonts
Field Value
| Type | Description |
|---|---|
| string[] |
DefaultFontSize
The size of font to use with the default font. The default is One.
Declaration
public IFont.Sizes DefaultFontSize
Field Value
| Type | Description |
|---|---|
| IFont.Sizes |
UseExtendedFont
Declaration
public bool UseExtendedFont
Field Value
| Type | Description |
|---|---|
| bool |
Properties
FontLoader
The method invoked by the GameHost as fonts are loaded.
Declaration
public Action<FontConfig, GameHost>? FontLoader { get; set; }
Property Value
| Type | Description |
|---|---|
| Action<FontConfig, GameHost> |
Methods
AddExtraFonts(params string[])
Loads the provided font files into SadConsole.
Declaration
public void AddExtraFonts(params string[] fontFiles)
Parameters
| Type | Name | Description |
|---|---|---|
| string[] | fontFiles | An array of font files to load. |
Run(BuilderBase, GameHost)
Invokes the FontLoader delegate.
Declaration
public void Run(BuilderBase config, GameHost game)
Parameters
| Type | Name | Description |
|---|---|---|
| BuilderBase | config | The builder running this configurator. |
| GameHost | game | The game being created. |
SetDefaultFontSize(Sizes)
Sets the default font size for the game. The default is One.
Declaration
public void SetDefaultFontSize(IFont.Sizes size)
Parameters
| Type | Name | Description |
|---|---|---|
| IFont.Sizes | size | The default font size. |
UseBuiltinFont()
Sets the default font to the SadConsole standard font, an IBM 8x16 font.
Declaration
public void UseBuiltinFont()
UseBuiltinFontExtended()
Sets the default font to the SadConsole extended font, an IBM 8x16 font with SadConsole specific characters past index 255.
Declaration
public void UseBuiltinFontExtended()
UseCustomFont(string)
Sets the default font in SadConsole to the specified font file.
Declaration
public void UseCustomFont(string fontFile)
Parameters
| Type | Name | Description |
|---|---|---|
| string | fontFile |