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-04-07 12:42:28 +0400
committerDiego Borghetti <bdiego@gmail.com>2009-04-07 12:42:28 +0400
commit59190778a8606079644b91992a3c90b7723e0adf (patch)
tree5c85797ca089fb34bab6ae4edc5f778538636692 /source/blender/blenfont/intern/blf_internal_types.h
parent44877d0add0101e92bdfc48d065df83a7b541063 (diff)
New Bitmap draw mode for Freetype2 fonts.
The library can load any font supported by the Freetype2 library or used the internal bitmap font. With both types it's possible draw the text as texture or bitmap, and using texture it's possible rotate, scale and clipping text. Still have things to fix/add, but I think it's ready to move-on and start droping the old api, most of (if it's not all) the editors/interface/text.c will be remove, but some things still has to be define, like: * Where is store the fonts ? (default font, panel font, filesel font, etc) I mean, every space have own fonts ? or we keep it on the context ? It's not a really problem from the blenfont side, because every font have reference number, so it's load only the first time. * What we do about gettext ? Keep the old system that call gettext inside the blenfont or replace it for _() in the Blender source ? Also things like pupmen has to be take care, if we want translate the menu. Ok, time to sleep, back tomorrow to start moving the things :)
Diffstat (limited to 'source/blender/blenfont/intern/blf_internal_types.h')
-rw-r--r--source/blender/blenfont/intern/blf_internal_types.h46
1 files changed, 33 insertions, 13 deletions
diff --git a/source/blender/blenfont/intern/blf_internal_types.h b/source/blender/blenfont/intern/blf_internal_types.h
index dba4c34c6bb..e176eb2040b 100644
--- a/source/blender/blenfont/intern/blf_internal_types.h
+++ b/source/blender/blenfont/intern/blf_internal_types.h
@@ -78,13 +78,7 @@ typedef struct GlyphCacheBLF {
float descender;
} GlyphCacheBLF;
-typedef struct GlyphBLF {
- struct GlyphBLF *next;
- struct GlyphBLF *prev;
-
- /* and the character, as UTF8 */
- unsigned int c;
-
+typedef struct GlyphTextureBLF {
/* texture id where this glyph is store. */
GLuint tex;
@@ -96,21 +90,47 @@ typedef struct GlyphBLF {
int width;
int height;
- /* glyph bounding box. */
- rctf box;
-
/* uv coords. */
float uv[2][2];
- /* advance value. */
- float advance;
-
/* X and Y bearing of the glyph.
* The X bearing is from the origin to the glyph left bbox edge.
* The Y bearing is from the baseline to the top of the glyph edge.
*/
float pos_x;
float pos_y;
+} GlyphTextureBLF;
+
+typedef struct GlyphBitmapBLF {
+ /* image data. */
+ unsigned char *image;
+
+ int width;
+ int height;
+ int pitch;
+
+ float pos_x;
+ float pos_y;
+} GlyphBitmapBLF;
+
+typedef struct GlyphBLF {
+ struct GlyphBLF *next;
+ struct GlyphBLF *prev;
+
+ /* and the character, as UTF8 */
+ unsigned int c;
+
+ /* glyph box. */
+ rctf box;
+
+ /* advance size. */
+ float advance;
+
+ /* texture information. */
+ GlyphTextureBLF *tex_data;
+
+ /* bitmap information. */
+ GlyphBitmapBLF *bitmap_data;
} GlyphBLF;
typedef struct FontBLF {