|
ps2sdk
1.1
A collection of Open Source libraries used for developing applications on Sony's PlayStation 2® (PS2).
|
#include <stdio.h>#include <stdlib.h>#include <malloc.h>#include <string.h>#include <draw.h>#include <draw3d.h>#include <font.h>
Include dependency graph for fsfont.c:Go to the source code of this file.
Macros | |
| #define | TAB '\t' |
| #define | NEWLINE '\n' |
| #define | SPACE ' ' |
| #define | DRAW_ST_REGLIST |
Functions | |
| fsfont_t * | fontstudio_init (int char_height) |
| void | fontstudio_free (fsfont_t *font) |
| char * | fontstudio_load_ini (const char *path) |
| int | fontstudio_parse_ini (fsfont_t *font, char *ini, float tex_width, float tex_height) |
| void | fontstudio_unload_ini (fsfont_t *font) |
| int | decode_unicode (const unsigned char *in, unsigned short *out) |
| unsigned short | get_char (unsigned short c, fsfont_t *font) |
| void | convert_to_index (unsigned short *in, int num, fsfont_t *font) |
| qword_t * | draw_fontstudio_char (qword_t *q, unsigned int c, vertex_t *v0, fsfont_t *font) |
| qword_t * | fontstudio_print_string (qword_t *q, int context, const unsigned char *str, int alignment, vertex_t *v0, color_t *c0, fsfont_t *font) |
Variables | |
| static prim_t | charprim |
| #define DRAW_ST_REGLIST |
| void convert_to_index | ( | unsigned short * | in, |
| int | num, | ||
| fsfont_t * | font | ||
| ) |
Definition at line 400 of file fsfont.c.
References get_char().
Referenced by fontstudio_print_string().
| int decode_unicode | ( | const unsigned char * | in, |
| unsigned short * | out | ||
| ) |
Definition at line 329 of file fsfont.c.
Referenced by fontstudio_print_string().
Definition at line 436 of file fsfont.c.
References fsfont_t::chardata, qword_t::dw, ftoi4, GIF_SET_UV, GIF_SET_XYZ, inidata_t::height, fsfont_t::scale, inidata_t::u1, inidata_t::u2, v0, inidata_t::v1, inidata_t::v2, inidata_t::width, x, and y.
Referenced by fontstudio_print_string().
| void fontstudio_free | ( | fsfont_t * | font | ) |
| 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 fsfont_t::height, and fsfont_t::scale.
| char* fontstudio_load_ini | ( | const char * | path | ) |
| 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 inidata_t::A, inidata_t::B, inidata_t::C, fsfont_t::chardata, fsfont_t::charmap, ftoi4, inidata_t::height, NULL, inidata_t::ox, inidata_t::oy, fsfont_t::spacewidth, fsfont_t::totalchars, inidata_t::u1, inidata_t::u2, inidata_t::v1, inidata_t::v2, and inidata_t::width.
Referenced by main().
| qword_t* fontstudio_print_string | ( | qword_t * | q, |
| int | context, | ||
| const unsigned char * | string, | ||
| int | alignment, | ||
| 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 inidata_t::A, inidata_t::B, inidata_t::C, CENTER_ALIGN, fsfont_t::chardata, charprim, context, convert_to_index(), decode_unicode(), draw_fontstudio_char(), draw_prim_end(), draw_prim_start(), DRAW_UV_REGLIST, fsfont_t::height, LEFT_ALIGN, NEWLINE, RIGHT_ALIGN, fsfont_t::scale, SPACE, fsfont_t::spacewidth, TAB, v0, vertex_t::x, and vertex_t::y.
Referenced by run_demo().
| void fontstudio_unload_ini | ( | fsfont_t * | font | ) |
Unloads a parsed font's ini file.
Definition at line 313 of file fsfont.c.
References fsfont_t::chardata, fsfont_t::charmap, and NULL.
Referenced by main().
| unsigned short get_char | ( | unsigned short | c, |
| fsfont_t * | font | ||
| ) |
Definition at line 379 of file fsfont.c.
References fsfont_t::charmap, and fsfont_t::totalchars.
Referenced by convert_to_index().
|
static |
Definition at line 11 of file fsfont.c.
Referenced by fontstudio_print_string().