ps2sdk
1.1
A collection of Open Source libraries used for developing applications on Sony's PlayStation 2® (PS2).
|
#include <draw.h>
#include <draw3d.h>
#include <gif_tags.h>
#include <gs_gp.h>
#include <stdio.h>
#include <malloc.h>
#include <sys/fcntl.h>
#include <string.h>
#include <fcntl.h>
#include <unistd.h>
#include <font.h>
Go to the source code of this file.
Data Structures | |
struct | fontx_hdr |
Functions | |
int | fontx_load_single_krom (fontx_t *fontx) |
int | fontx_load_double_krom (fontx_t *fontx) |
int | fontx_load (const char *path, fontx_t *fontx, int type, int wmargin, int hmargin, int bold) |
void | fontx_unload (fontx_t *fontx) |
char * | fontx_get_char (fontx_t *fontx, unsigned short c) |
u64 * | draw_fontx_row (u64 *dw, unsigned char byte, int x, int y, int z, int bold) |
qword_t * | draw_fontx_char (qword_t *q, unsigned short c, vertex_t *v0, fontx_t *fontx) |
qword_t * | fontx_print_ascii (qword_t *q, int context, const unsigned char *str, int alignment, 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, vertex_t *v0, color_t *c0, fontx_t *ascii, fontx_t *kanji) |
Variables | |
static prim_t | charprim |
unsigned short | sjis_table [] |
Definition at line 502 of file fontx.c.
References fontx_t::bold, draw_fontx_row(), fontx_t::font, fontx_get_char(), ftoi4, fontx_hdr::height, fontx_t::rowsize, v0, x, and y.
Referenced by fontx_print_ascii(), and fontx_print_sjis().
Definition at line 456 of file fontx.c.
References GS_SET_XYZ, x, and y.
Referenced by draw_fontx_char().
char* fontx_get_char | ( | fontx_t * | fontx, |
unsigned short | c | ||
) |
Definition at line 395 of file fontx.c.
References fontx_hdr::block, fontx_t::charsize, fontx_hdr::end, fontx_t::font, NULL, fontx_t::offset, SINGLE_BYTE, fontx_hdr::start, fontx_hdr::table_num, and fontx_hdr::type.
Referenced by draw_fontx_char().
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_double_krom(), fontx_load_single_krom(), fontx_t::h_margin, fontx_hdr::height, fontx_hdr::id, fontx_t::name, fontx_hdr::name, NULL, 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 main().
int fontx_load_double_krom | ( | fontx_t * | fontx | ) |
Definition at line 180 of file fontx.c.
References DOUBLE_BYTE, fontx_t::font, fontx_hdr::height, fontx_hdr::id, fontx_hdr::name, NULL, sjis_table, fontx_hdr::table_num, fontx_hdr::type, and fontx_hdr::width.
Referenced by fontx_load().
int fontx_load_single_krom | ( | fontx_t * | fontx | ) |
Definition at line 102 of file fontx.c.
References fontx_t::font, fontx_hdr::height, fontx_hdr::id, fontx_hdr::name, NULL, SINGLE_BYTE, fontx_hdr::type, and fontx_hdr::width.
Referenced by fontx_load().
qword_t* fontx_print_ascii | ( | qword_t * | q, |
int | context, | ||
const unsigned char * | str, | ||
int | alignment, | ||
vertex_t * | v0, | ||
color_t * | c0, | ||
fontx_t * | fontx | ||
) |
Prints an ascii/JISX201 formatted string
Definition at line 559 of file fontx.c.
References CENTER_ALIGN, charprim, context, draw_fontx_char(), draw_prim_end(), draw_prim_start(), DRAW_XYZ_REGLIST, fontx_t::font, fontx_t::h_margin, fontx_hdr::height, LEFT_ALIGN, RIGHT_ALIGN, v0, fontx_t::w_margin, and fontx_hdr::width.
qword_t* fontx_print_sjis | ( | qword_t * | q, |
int | context, | ||
const unsigned char * | str, | ||
int | alignment, | ||
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 CENTER_ALIGN, charprim, context, draw_fontx_char(), draw_prim_end(), draw_prim_start(), DRAW_XYZ_REGLIST, fontx_t::font, fontx_t::h_margin, LEFT_ALIGN, RIGHT_ALIGN, v0, fontx_t::w_margin, fontx_hdr::width, vertex_t::x, and vertex_t::y.
Referenced by run_demo().
void fontx_unload | ( | fontx_t * | fontx | ) |
|
static |
Definition at line 40 of file fontx.c.
Referenced by fontx_print_ascii(), and fontx_print_sjis().
unsigned short sjis_table[] |
Definition at line 48 of file fontx.c.
Referenced by fontx_load_double_krom().