Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiego Borghetti <bdiego@gmail.com>2009-08-18 23:26:53 +0400
committerDiego Borghetti <bdiego@gmail.com>2009-08-18 23:26:53 +0400
commit7d812822bd9c522efc0730a4f219ccec9cfb4a57 (patch)
treeabd0a537d339cb3f4c63a05ab9016b96312671ca /source/blender/blenfont/BLF_api.h
parent94511c672920e8ae0ebca4fca2a563a46d07b85b (diff)
Stamp info back only for float buffer. (next commit add unsigned char).
A couple of new functions: BLF_width_and_height - Merge of BLF_width and BLF_height in one call to avoid freetype2 stuff. BLF_buffer - Set the buffer, size and number of channel. BLF_buffer_col - Set the text color (the alpha is not used right now). BLF_draw_buffer - Draw the text in the current buffer. Also tweak a little the boundbox and draw function to avoid access the freetype2 and use the cache info. By default the font size is 12, the UI still need work to allow change the font and size.
Diffstat (limited to 'source/blender/blenfont/BLF_api.h')
-rw-r--r--source/blender/blenfont/BLF_api.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/source/blender/blenfont/BLF_api.h b/source/blender/blenfont/BLF_api.h
index 05df927f921..760b7059bc7 100644
--- a/source/blender/blenfont/BLF_api.h
+++ b/source/blender/blenfont/BLF_api.h
@@ -70,6 +70,11 @@ void BLF_boundbox(char *str, struct rctf *box);
float BLF_width(char *str);
float BLF_height(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(char *str, float *width, float *height);
/*
* For fixed width fonts only, returns the width of a
@@ -117,6 +122,28 @@ void BLF_shadow(int level, float r, float g, float b, float a);
void BLF_shadow_offset(int x, int y);
/*
+ * Set the buffer, size and number of channels to draw, one thing to take care is call
+ * this function with NULL pointer when we finish, for example:
+ * BLF_buffer(my_fbuf, my_cbuf, 100, 100, 4);
+ *
+ * ... set color, position and draw ...
+ *
+ * BLF_buffer(NULL, NULL, 0, 0, 0);
+ */
+void BLF_buffer(float *fbuf, unsigned char *cbuf, unsigned int w, unsigned int h, int nch);
+
+/*
+ * Set the color to be used for text.
+ */
+void BLF_buffer_col(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(char *str);
+
+/*
* Search the path directory to the locale files, this try all
* the case for Linux, Win and Mac.
*/