GBDK 2020 Docs API Documentation for GBDK 2020

Data Structures | Macros | Typedefs | Functions | Variables
font.h File Reference
`#include <gb/gb.h>`

Go to the source code of this file.

## Data Structures
struct | sfont_handle

## Macros
#define | FONT_256ENCODING 0
#define | FONT_128ENCODING 1
#define | FONT_NOENCODING 2
#define | FONT_COMPRESSED 4

## Typedefs
typedef UINT16 | font_t
typedef struct sfont_handle | mfont_handle
typedef struct sfont_handle * | pmfont_handle

## Functions
void | font_init (void) NONBANKED
font_t | font_load (void *font) NONBANKED
font_t | font_set (font_t font_handle) NONBANKED

## Variables
UINT8 | font_spect []
UINT8 | font_italic []
UINT8 | font_ibm []
UINT8 | font_min []
UINT8 | font_ibm_fixed []

## Detailed Description

Multiple font support for the GameBoy Michael Hope, 1999 micha.nosp@m.elh@.nosp@m.earth.nosp@m.ling.nosp@m..net

## Macro Definition Documentation

## ◆ FONT_256ENCODING

#define FONT_256ENCODING 0

Various flags in the font header.

## ◆ FONT_128ENCODING

#define FONT_128ENCODING 1

## ◆ FONT_NOENCODING

#define FONT_NOENCODING 2

## ◆ FONT_COMPRESSED

#define FONT_COMPRESSED 4

## Typedef Documentation

## ◆ font_t

typedef UINT16 font_t

font_t is a handle to a font loaded by font_load(). It can be used with font_set()

## ◆ mfont_handle

typedef struct sfont_handle mfont_handle

Internal representation of a font. What a font_t really is

## ◆ pmfont_handle

typedef struct sfont_handle* pmfont_handle

## Function Documentation

## ◆ font_init()

void font_init | ( | void |  | ) |

Initializes the font system. Should be called before other font functions.

## ◆ font_load()

font_t font_load | ( | void * | font | ) |

Load a font and set it as the current font.

Parameters

  font | Pointer to a font to load (usually a gbdk font)

Returns
  Handle to the loaded font, which can be used with font_set()

See also
  font_init(), font_set(), List of gbdk fonts

## ◆ font_set()

font_t font_set | ( | font_t | font_handle | ) |

Set the current font.

Parameters

  font_handle | handle of a font returned by font_load()

Returns
  The previously used font handle.

See also
  font_init(), font_load()