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/BLF_api.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/BLF_api.h')
-rw-r--r--source/blender/blenfont/BLF_api.h23
1 files changed, 20 insertions, 3 deletions
diff --git a/source/blender/blenfont/BLF_api.h b/source/blender/blenfont/BLF_api.h
index a5c4e037a2d..d6f0cf38558 100644
--- a/source/blender/blenfont/BLF_api.h
+++ b/source/blender/blenfont/BLF_api.h
@@ -37,24 +37,41 @@ void BLF_exit(void);
int BLF_load(char *name);
int BLF_load_mem(char *name, unsigned char *mem, int mem_size);
+/*
+ * Set/Get the current font.
+ */
void BLF_set(int fontid);
+int BLF_get(void);
+
void BLF_aspect(float aspect);
void BLF_position(float x, float y, float z);
void BLF_size(int size, int dpi);
void BLF_draw(char *str);
+/*
+ * This function return the bounding box of the string
+ * and are not multiplied by the aspect.
+ */
void BLF_boundbox(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(char *str);
float BLF_height(char *str);
+
+/*
+ * By default, rotation and clipping are disable and
+ * have to be enable/disable using BLF_enable/disable.
+ */
void BLF_rotation(float angle);
void BLF_clipping(float xmin, float ymin, float xmax, float ymax);
void BLF_enable(int option);
void BLF_disable(int option);
-/* return the id of the current font. */
-int BLF_get(void);
-
/* Read the .Blanguages file, return 1 on success or 0 if fails. */
int BLF_lang_init(void);