diff options
| author | Jakob Fries <jakob.fries@gmail.com> | 2007-12-22 02:55:19 +0000 |
|---|---|---|
| committer | Jakob Fries <jakob.fries@gmail.com> | 2007-12-22 02:55:19 +0000 |
| commit | 1ddfbba3666a835b59fc79b59aaae367ee93a6ea (patch) | |
| tree | e5304209e6a0ab62c083aee01bc46d68333cd2cd /src/engine/client/ec_ui.h | |
| parent | 87b89138f42bbc1a276c4e92429ce651500e871c (diff) | |
| download | zcatch-1ddfbba3666a835b59fc79b59aaae367ee93a6ea.tar.gz zcatch-1ddfbba3666a835b59fc79b59aaae367ee93a6ea.zip | |
add new font stuff
Diffstat (limited to 'src/engine/client/ec_ui.h')
| -rw-r--r-- | src/engine/client/ec_ui.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/engine/client/ec_ui.h b/src/engine/client/ec_ui.h index 15c63b90..3464a2e6 100644 --- a/src/engine/client/ec_ui.h +++ b/src/engine/client/ec_ui.h @@ -29,6 +29,33 @@ void ui_do_image(int texture, float x, float y, float w, float h); void ui_do_label(float x, float y, const char *text, float size); int ui_do_button(const void *id, const char *text, int checked, float x, float y, float w, float h, draw_button_callback draw_func, void *extra); +typedef struct +{ + float tex_x0; + float tex_y0; + float tex_x1; + float tex_y1; + float width; + float height; + float x_offset; + float y_offset; + float x_advance; +} +CHARACTER; + +typedef struct +{ + int texture; + CHARACTER characters[256]; + float kerning[256*256]; +} FONT; + +int font_load(FONT *font, const char *filename); +int font_save(FONT *font, const char *filename); +float font_string_width(FONT *font, const char *string, float size); +void font_character_info(FONT *font, unsigned char c, float *tex_x0, float *tex_y0, float *tex_x1, float *tex_y1, float *width, float *height, float *x_offset, float *y_offset, float *x_advance); +void font_render(FONT *font, const char *string, float x, float y, float size); + #ifdef __cplusplus } #endif |