PS2SDK
PS2 Homebrew Libraries
|
Go to the source code of this file.
Data Structures | |
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, 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, 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, color_t *c0, fsfont_t *font) |
Font library.
Definition in file font.h.
struct fontx_t |
struct inidata_t |
struct fsfont_t |
int fontx_load | ( | const char * | path, |
fontx_t * | fontx, | ||
int | type, | ||
int | wmargin, | ||
int | hmargin, | ||
int | bold | ||
) |
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.
References fontx_t::bold, fontx_t::charsize, fontx_t::font, fontx_load(), fontx_t::h_margin, fontx_hdr::height, fontx_hdr::id, fontx_t::name, fontx_hdr::name, fontx_t::offset, fontx_t::rowsize, SINGLE_BYTE, fontx_hdr::table_num, fontx_hdr::type, fontx_t::w_margin, and fontx_hdr::width.
Referenced by fontx_load().
void fontx_unload | ( | fontx_t * | fontx | ) |
Frees memory if a font is loaded
Definition at line 382 of file fontx.c.
References fontx_t::font, and fontx_unload().
Referenced by fontx_unload().
qword_t * fontx_print_ascii | ( | qword_t * | q, |
int | context, | ||
const unsigned char * | str, | ||
int | alignment, | ||
const vertex_t * | v0, | ||
color_t * | c0, | ||
fontx_t * | fontx | ||
) |
Prints an ascii/JISX201 formatted string
Definition at line 559 of file fontx.c.
References draw_prim_end(), draw_prim_start(), DRAW_XYZ_REGLIST, fontx_t::font, fontx_print_ascii(), fontx_t::h_margin, fontx_hdr::height, LEFT_ALIGN, fontx_t::w_margin, and fontx_hdr::width.
Referenced by fontx_print_ascii().
qword_t * fontx_print_sjis | ( | qword_t * | q, |
int | context, | ||
const unsigned char * | str, | ||
int | alignment, | ||
const vertex_t * | v0, | ||
color_t * | c0, | ||
fontx_t * | ascii, | ||
fontx_t * | kanji | ||
) |
Prints a SJIS formatted string
Definition at line 735 of file fontx.c.
References draw_prim_end(), draw_prim_start(), DRAW_XYZ_REGLIST, fontx_t::font, fontx_print_sjis(), fontx_t::h_margin, fontx_hdr::height, LEFT_ALIGN, fontx_t::w_margin, and fontx_hdr::width.
Referenced by fontx_print_sjis().
fsfont_t * fontstudio_init | ( | int | height | ) |
Loads the FontStudio ini file that contains the font texture's characteristics
Definition at line 22 of file fsfont.c.
References fontstudio_init().
Referenced by fontstudio_init().
int fontstudio_parse_ini | ( | fsfont_t * | font, |
char * | ini, | ||
float | tex_width, | ||
float | tex_height | ||
) |
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.
References fontstudio_parse_ini().
Referenced by fontstudio_parse_ini().
char * fontstudio_load_ini | ( | const char * | path | ) |
Loads an ini file into memory and returns pointer to it
Definition at line 53 of file fsfont.c.
References fontstudio_load_ini().
Referenced by fontstudio_load_ini().
void fontstudio_unload_ini | ( | fsfont_t * | font | ) |
Unloads a parsed font's ini file.
Definition at line 313 of file fsfont.c.
References fontstudio_unload_ini().
Referenced by fontstudio_unload_ini().
qword_t * fontstudio_print_string | ( | qword_t * | q, |
int | context, | ||
const unsigned char * | string, | ||
int | alignment, | ||
const vertex_t * | v0, | ||
color_t * | c0, | ||
fsfont_t * | font | ||
) |
Prints a unicode formatted string (UTF+8)
Definition at line 456 of file fsfont.c.
References draw_prim_end(), draw_prim_start(), fontstudio_print_string(), and LEFT_ALIGN.
Referenced by fontstudio_print_string().