diff options
author | Diego Borghetti <bdiego@gmail.com> | 2009-02-19 19:39:36 +0300 |
---|---|---|
committer | Diego Borghetti <bdiego@gmail.com> | 2009-02-19 19:39:36 +0300 |
commit | 6bf9f383dc3d0dc271dd3ffa3e22becea5675530 (patch) | |
tree | 2a77c248e1cb9952e5474cce1b7714b9b77e4be2 /source/blender/editors/space_info | |
parent | f377be3783937e5979efa9952296af1a72909a54 (diff) |
4 new function, boundbox, width, height and rotation.
The rotation is through glRotatef and as you can see it's ugly,
the freetype2 allow apply a transformation (2x2 mat) to the glyph
before load, so I want to try using that.
Another thing to add is the 4x4 mat to get the scale and size from
there.. but I need commit this now to continue from my home.
Diffstat (limited to 'source/blender/editors/space_info')
-rw-r--r-- | source/blender/editors/space_info/space_info.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/source/blender/editors/space_info/space_info.c b/source/blender/editors/space_info/space_info.c index 6d7fb5a1cdf..f1968114b14 100644 --- a/source/blender/editors/space_info/space_info.c +++ b/source/blender/editors/space_info/space_info.c @@ -133,7 +133,8 @@ static void info_main_area_draw(const bContext *C, ARegion *ar) // SpaceInfo *sinfo= (SpaceInfo*)CTX_wm_space_data(C); View2D *v2d= &ar->v2d; float col[3]; - + float width, height; + /* clear and setup matrix */ UI_GetThemeColor3fv(TH_BACK, col); glClearColor(col[0], col[1], col[2], 0.0); @@ -148,21 +149,30 @@ static void info_main_area_draw(const bContext *C, ARegion *ar) BLF_size(14, 96); BLF_position(5.0, 5.0, 0.0); - BLF_draw("Hello Blender, size 14, dpi 96"); + + width= BLF_width("Hello Blender, size 14, dpi 96"); + height= BLF_height("Hello Blender, size 14, dpi 96"); + + glRectf(7.0, 20.0, 7.0+width, 20.0+height); + glRectf(5.0+width+10.0, 3.0, 5.0+width+10.0+width, 3.0+height); + BLF_draw("Hello Blender, size 14, dpi 96"); glColor3f(0.0, 0.0, 1.0); BLF_size(11, 96); BLF_position(200.0, 50.0, 0.0); + BLF_rotation(45.0f); BLF_draw("Another Hello Blender, size 11 and dpi 96!!"); glColor3f(0.8, 0.0, 0.7); BLF_size(12, 72); - BLF_position(5.0, 100.0, 0.0); + BLF_position(200.0, 100.0, 0.0); + BLF_rotation(180.0f); BLF_draw("Hello World, size 12, dpi 72"); glColor3f(0.8, 0.7, 0.5); BLF_size(12, 96); BLF_position(5.0, 200.0, 0.0); + BLF_rotation(0.0f); BLF_draw("And this make a new glyph cache!!"); /* reset view matrix */ |