libnds
Loading...
Searching...
No Matches
Data Fields
ConsoleFont Struct Reference

A font struct for the console. More...

#include <console.h>

Data Fields

u16 asciiOffset
 Offset to the first valid character in the font table.
 
u8 bpp
 Bits per pixel in the font graphics.
 
const void * gfx
 Pointer to the font graphics.
 
u16 numChars
 Number of characters in the font graphics to be loaded.
 
u16 numColors
 Number of colors in the font palette to be loaded.
 
const void * pal
 Pointer to the font palette.
 

Detailed Description

A font struct for the console.

The graphics defined in this struct are loaded by consoleInit() if loadGraphics is true, and by consoleSetFont().

Warning
The space character must always be included in the font! It is required by the functions that clear the console, and it is printed when characters that are out of range are sent to the console.

Field Documentation

◆ asciiOffset

u16 ConsoleFont::asciiOffset

Offset to the first valid character in the font table.

This is useful to save space at the beginning of the font, where there are lots of non-printable ASCII characters.

◆ bpp

u8 ConsoleFont::bpp

Bits per pixel in the font graphics.

4 BPP and 8 BPP graphics are loaded as they are provided. 1 BPP fonts are extended to 4 BPP and then treated like a 4 BPP font.

◆ gfx

const void* ConsoleFont::gfx

Pointer to the font graphics.

This pointer can't be NULL.

◆ pal

const void* ConsoleFont::pal

Pointer to the font palette.

If this pointer is NULL, the default palettes will be loaded instead. For 1 BPP and 4BPP fonts, 16 different palettes will be setup to be able to change the color of the text. For 8 BPP palettes, there is only one palette, so the only color that is loaded is white.


The documentation for this struct was generated from the following file: