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/intern/blf_internal_types.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/intern/blf_internal_types.h')
-rw-r--r--source/blender/blenfont/intern/blf_internal_types.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/source/blender/blenfont/intern/blf_internal_types.h b/source/blender/blenfont/intern/blf_internal_types.h
index d457225662f..fb4a2e6a9e5 100644
--- a/source/blender/blenfont/intern/blf_internal_types.h
+++ b/source/blender/blenfont/intern/blf_internal_types.h
@@ -85,6 +85,9 @@ typedef struct GlyphBLF {
/* and the character, as UTF8 */
unsigned int c;
+ /* freetype2 index, to speed-up the search. */
+ FT_UInt idx;
+
/* glyph box. */
rctf box;
@@ -106,6 +109,7 @@ typedef struct GlyphBLF {
/* glyph width and height. */
int width;
int height;
+ int pitch;
/* uv coords. */
float uv[2][2];
@@ -176,6 +180,22 @@ typedef struct FontBLF {
/* freetype2 face. */
FT_Face face;
+
+ /* for draw to buffer, always set this to NULL after finish! */
+ float *b_fbuf;
+
+ /* the same but unsigned char */
+ unsigned char *b_cbuf;
+
+ /* buffer size. */
+ unsigned int bw;
+ unsigned int bh;
+
+ /* number of channels. */
+ int bch;
+
+ /* and the color, the alphas is get from the glyph! */
+ float b_col[4];
} FontBLF;
typedef struct DirBLF {