diff options
Diffstat (limited to 'source/blender/blenfont/BLF_api.h')
-rw-r--r-- | source/blender/blenfont/BLF_api.h | 56 |
1 files changed, 41 insertions, 15 deletions
diff --git a/source/blender/blenfont/BLF_api.h b/source/blender/blenfont/BLF_api.h index 933d287bcff..e2245a9f049 100644 --- a/source/blender/blenfont/BLF_api.h +++ b/source/blender/blenfont/BLF_api.h @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** @@ -34,44 +34,62 @@ struct rctf; int BLF_init(int points, int dpi); void BLF_exit(void); -int BLF_load(char *name); -int BLF_load_mem(char *name, unsigned char *mem, int mem_size); +void BLF_cache_clear(void); + +int BLF_load(const char *name); +int BLF_load_mem(const char *name, unsigned char *mem, int mem_size); -int BLF_load_unique(char *name); -int BLF_load_mem_unique(char *name, unsigned char *mem, int mem_size); +int BLF_load_unique(const char *name); +int BLF_load_mem_unique(const char *name, unsigned char *mem, int mem_size); /* Attach a file with metrics information from memory. */ void BLF_metrics_attach(int fontid, unsigned char *mem, int mem_size); -void BLF_aspect(int fontid, float aspect); +void BLF_aspect(int fontid, float x, float y, float z); void BLF_position(int fontid, float x, float y, float z); void BLF_size(int fontid, int size, int dpi); +/* Set a 4x4 matrix to be multiplied before draw the text. + * Remember that you need call BLF_enable(BLF_MATRIX) + * to enable this. + * + * The order of the matrix is like GL: + + | m[0] m[4] m[8] m[12] | + | m[1] m[5] m[9] m[13] | + | m[2] m[6] m[10] m[14] | + | m[3] m[7] m[11] m[15] | + + */ +void BLF_matrix(int fontid, double *m); + /* Draw the string using the default font, size and dpi. */ -void BLF_draw_default(float x, float y, float z, char *str); +void BLF_draw_default(float x, float y, float z, const char *str, size_t len); +void BLF_draw_default_ascii(float x, float y, float z, const char *str, size_t len); /* Draw the string using the current font. */ -void BLF_draw(int fontid, char *str); +void BLF_draw(int fontid, const char *str, size_t len); +void BLF_draw_ascii(int fontid, const char *str, size_t len); /* * This function return the bounding box of the string * and are not multiplied by the aspect. */ -void BLF_boundbox(int fontid, char *str, struct rctf *box); +void BLF_boundbox(int fontid, const char *str, struct rctf *box); /* * The next both function return the width and height * of the string, using the current font and both value * are multiplied by the aspect of the font. */ -float BLF_width(int fontid, char *str); -float BLF_height(int fontid, char *str); +float BLF_width(int fontid, const char *str); +float BLF_height(int fontid, const char *str); /* * The following function return the width and height of the string, but * just in one call, so avoid extra freetype2 stuff. */ -void BLF_width_and_height(int fontid, char *str, float *width, float *height); +void BLF_width_and_height(int fontid, const char *str, float *width, float *height); /* * For fixed width fonts only, returns the width of a @@ -84,8 +102,8 @@ float BLF_fixed_width(int fontid); * of the string, using the default font and both value * are multiplied by the aspect of the font. */ -float BLF_width_default(char *str); -float BLF_height_default(char *str); +float BLF_width_default(const char *str); +float BLF_height_default(const char *str); /* * Set rotation for default font. @@ -145,7 +163,7 @@ void BLF_buffer_col(int fontid, float r, float g, float b, float a); * Draw the string into the buffer, this function draw in both buffer, float and unsigned char _BUT_ * it's not necessary set both buffer, NULL is valid here. */ -void BLF_draw_buffer(int fontid, char *str); +void BLF_draw_buffer(int fontid, const char *str); /* * Search the path directory to the locale files, this try all @@ -159,6 +177,8 @@ void BLF_lang_set(const char *); /* Set the current encoding name. */ void BLF_lang_encoding_name(const char *str); +void BLF_lang_encoding(const char *str); + /* Add a path to the font dir paths. */ void BLF_dir_add(const char *path); @@ -176,5 +196,11 @@ void BLF_dir_free(char **dirs, int count); #define BLF_CLIPPING (1<<1) #define BLF_SHADOW (1<<2) #define BLF_KERNING_DEFAULT (1<<3) +#define BLF_MATRIX (1<<4) +#define BLF_ASPECT (1<<5) + +// XXX, bad design +extern int blf_mono_font; +extern int blf_mono_font_render; // dont mess drawing with render threads. #endif /* BLF_API_H */ |