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:
authorCampbell Barton <ideasman42@gmail.com>2013-12-02 13:33:45 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-12-02 14:10:07 +0400
commit1815225faa75eb64e83fdc9f066fcd6339502d52 (patch)
tree6558780d85792c9c41fcf280069870fae70eed7a /source/blender/blenfont/BLF_api.h
parentf64ae4cbe5a724496624de9e479c04f325613be5 (diff)
Blender Font (BLF): add length argument to string width/height functions
This also fixes a crash editing buttons longer then UI_MAX_DRAW_STR
Diffstat (limited to 'source/blender/blenfont/BLF_api.h')
-rw-r--r--source/blender/blenfont/BLF_api.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/source/blender/blenfont/BLF_api.h b/source/blender/blenfont/BLF_api.h
index 8f77f8c984d..b25166f4b18 100644
--- a/source/blender/blenfont/BLF_api.h
+++ b/source/blender/blenfont/BLF_api.h
@@ -82,14 +82,14 @@ int BLF_draw_mono(int fontid, const char *str, size_t len, int cwidth);
/* This function return the bounding box of the string
* and are not multiplied by the aspect.
*/
-void BLF_boundbox(int fontid, const char *str, struct rctf *box);
+void BLF_boundbox(int fontid, const char *str, size_t len, 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(int fontid, const char *str);
-float BLF_height(int fontid, const char *str);
+float BLF_width(int fontid, const char *str, size_t len);
+float BLF_height(int fontid, const char *str, size_t len);
/* Return dimensions of the font without any sample text. */
float BLF_height_max(int fontid);
@@ -100,7 +100,7 @@ float BLF_ascender(int fontid);
/* 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(int fontid, const char *str, float *width, float *height);
+void BLF_width_and_height(int fontid, const char *str, size_t len, float *r_width, float *r_height);
/* For fixed width fonts only, returns the width of a
* character.
@@ -111,9 +111,9 @@ float BLF_fixed_width(int fontid);
* of the string, using the default font and both value
* are multiplied by the aspect of the font.
*/
-void BLF_width_and_height_default(const char *str, float *width, float *height);
-float BLF_width_default(const char *str);
-float BLF_height_default(const char *str);
+void BLF_width_and_height_default(const char *str, size_t len, float *r_width, float *r_height);
+float BLF_width_default(const char *str, size_t len);
+float BLF_height_default(const char *str, size_t len);
/* Set rotation for default font. */
void BLF_rotation_default(float angle);