diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-01-23 06:29:49 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-01-23 06:29:49 +0400 |
commit | 2f46ed5564ffb3d0550b09ee905bd37decb4a4b6 (patch) | |
tree | 5f3fa8d06ca6d98f1068f2536eaaa8857c16cbc9 /source/blender/gpu/intern | |
parent | c700103eabd2c5e80d05b85e6a2926485294eb49 (diff) |
Fix T38325: Game Engine Bitmap fonts failed for characters >128
Diffstat (limited to 'source/blender/gpu/intern')
-rw-r--r-- | source/blender/gpu/intern/gpu_draw.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/source/blender/gpu/intern/gpu_draw.c b/source/blender/gpu/intern/gpu_draw.c index 5ee30c242c1..74112583a3f 100644 --- a/source/blender/gpu/intern/gpu_draw.c +++ b/source/blender/gpu/intern/gpu_draw.c @@ -96,7 +96,8 @@ void GPU_render_text(MTFace *tface, int mode, if ((mode & GEMAT_TEXT) && (textlen>0) && tface->tpage) { Image* ima = (Image *)tface->tpage; ImBuf *first_ibuf; - int index, character; + const size_t textlen_st = textlen; + size_t index, character; float centerx, centery, sizex, sizey, transx, transy, movex, movey, advance; float advance_tab; @@ -127,11 +128,11 @@ void GPU_render_text(MTFace *tface, int mode, advance_tab= advance * 4; /* tab width could also be an option */ - for (index = 0; index < textlen; index++) { + for (index = 0; index < textlen_st; ) { float uv[4][2]; // lets calculate offset stuff - character = textstr[index]; + character = BLI_str_utf8_as_unicode_and_size_safe(textstr + index, &index); if (character=='\n') { glTranslatef(line_start, -line_height, 0.0); |