sdk-core v2026.11.05
PS2 SDK - core tier (build-critical EE/IOP modules)
Loading...
Searching...
No Matches
font.h File Reference
#include <draw.h>
#include <tamtypes.h>

Go to the source code of this file.

Classes

struct  fontx_t
struct  inidata_t
struct  fsfont_t

Macros

#define SINGLE_BYTE   0
#define DOUBLE_BYTE   1
#define LEFT_ALIGN   0
#define CENTER_ALIGN   1
#define RIGHT_ALIGN   2

Functions

int fontx_load (const char *path, fontx_t *fontx, int type, int wmargin, int hmargin, int bold)
void fontx_unload (fontx_t *fontx)
qword_t * fontx_print_ascii (qword_t *q, int context, const unsigned char *str, int alignment, const vertex_t *v0, const color_t *c0, fontx_t *fontx)
qword_t * fontx_print_sjis (qword_t *q, int context, const unsigned char *str, int alignment, const vertex_t *v0, const color_t *c0, fontx_t *ascii, fontx_t *kanji)
fsfont_t * fontstudio_init (int height)
void fontstudio_free (fsfont_t *font)
int fontstudio_parse_ini (fsfont_t *font, char *ini, float tex_width, float tex_height)
char * fontstudio_load_ini (const char *path)
void fontstudio_unload_ini (fsfont_t *font)
qword_t * fontstudio_print_string (qword_t *q, int context, const unsigned char *string, int alignment, const vertex_t *v0, const color_t *c0, fsfont_t *font)

Detailed Description

Font library.

Definition in file font.h.

Macro Definition Documentation

◆ CENTER_ALIGN

#define CENTER_ALIGN   1

Definition at line 62 of file font.h.

◆ DOUBLE_BYTE

#define DOUBLE_BYTE   1

Definition at line 15 of file font.h.

◆ LEFT_ALIGN

#define LEFT_ALIGN   0

Alignments

Definition at line 61 of file font.h.

◆ RIGHT_ALIGN

#define RIGHT_ALIGN   2

Definition at line 63 of file font.h.

◆ SINGLE_BYTE

#define SINGLE_BYTE   0

FontX2 types

Definition at line 14 of file font.h.

Function Documentation

◆ fontstudio_free()

void fontstudio_free ( fsfont_t * font)
extern

Definition at line 36 of file fsfont.c.

◆ fontstudio_init()

fsfont_t * fontstudio_init ( int height)
extern

Loads the FontStudio ini file that contains the font texture's characteristics

Definition at line 22 of file fsfont.c.

◆ fontstudio_load_ini()

char * fontstudio_load_ini ( const char * path)
extern

Loads an ini file into memory and returns pointer to it

Definition at line 53 of file fsfont.c.

◆ fontstudio_parse_ini()

int fontstudio_parse_ini ( fsfont_t * font,
char * ini,
float tex_width,
float tex_height )
extern

Parses a font's ini for the font. The content of ini is no longer required afterwards and can be discarded.

Definition at line 91 of file fsfont.c.

◆ fontstudio_print_string()

qword_t * fontstudio_print_string ( qword_t * q,
int context,
const unsigned char * string,
int alignment,
const vertex_t * v0,
const color_t * c0,
fsfont_t * font )
extern

Prints a unicode formatted string (UTF+8)

Definition at line 456 of file fsfont.c.

◆ fontstudio_unload_ini()

void fontstudio_unload_ini ( fsfont_t * font)
extern

Unloads a parsed font's ini file.

Definition at line 313 of file fsfont.c.

◆ fontx_load()

int fontx_load ( const char * path,
fontx_t * fontx,
int type,
int wmargin,
int hmargin,
int bold )
extern

Loads a FontX2 type font with set characteristics Use "rom0:KROM" as the path to load the PS2's internal FontX2 font

Definition at line 262 of file fontx.c.

◆ fontx_print_ascii()

qword_t * fontx_print_ascii ( qword_t * q,
int context,
const unsigned char * str,
int alignment,
const vertex_t * v0,
const color_t * c0,
fontx_t * fontx )
extern

Prints an ascii/JISX201 formatted string

Definition at line 559 of file fontx.c.

◆ fontx_print_sjis()

qword_t * fontx_print_sjis ( qword_t * q,
int context,
const unsigned char * str,
int alignment,
const vertex_t * v0,
const color_t * c0,
fontx_t * ascii,
fontx_t * kanji )
extern

Prints a SJIS formatted string

Definition at line 735 of file fontx.c.

◆ fontx_unload()

void fontx_unload ( fontx_t * fontx)
extern

Frees memory if a font is loaded

Definition at line 382 of file fontx.c.