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:
authorBastien Montagne <montagne29@wanadoo.fr>2015-10-03 10:25:44 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2015-10-03 10:29:37 +0300
commitffe03cd264f39d27047393d4db745ea8dae19d5f (patch)
tree086ad147a28d2647d8d0367933764ed64e2c6719 /source/blender/blenfont/intern/blf_thumbs.c
parent41d05474904bbffcb2bfa338a8dd91e2098360b3 (diff)
Fix Broken Font Preview (reported over IRC by kopias, thanks).
Broken by font wrap commit rBf2341f829654c4dc97, there was actually two things here: * Using non-initialized color (which lead to transparent drawing...), we need to use new `blf_draw_buffer__start/end` helpers here too, made them shared internally. * Using `draw_str_i18n_nbr` as `draw_str[i]` length, ugh! That's the number of utf8 glyphs of translated string, not the length of untranslated string! This fix must be backported to final 2.76.
Diffstat (limited to 'source/blender/blenfont/intern/blf_thumbs.c')
-rw-r--r--source/blender/blenfont/intern/blf_thumbs.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/source/blender/blenfont/intern/blf_thumbs.c b/source/blender/blenfont/intern/blf_thumbs.c
index 76479593b54..133168fccf2 100644
--- a/source/blender/blenfont/intern/blf_thumbs.c
+++ b/source/blender/blenfont/intern/blf_thumbs.c
@@ -89,6 +89,8 @@ void BLF_thumb_preview(
font_size_curr = font_size;
+ blf_draw_buffer__start(font);
+
for (i = 0; i < draw_str_lines; i++) {
const char *draw_str_i18n = BLT_translate_do(BLT_I18NCONTEXT_DEFAULT, draw_str[i]);
const size_t draw_str_i18n_len = strlen(draw_str_i18n);
@@ -110,12 +112,13 @@ void BLF_thumb_preview(
if (blf_font_count_missing_chars(
font, draw_str_i18n, draw_str_i18n_len, &draw_str_i18n_nbr) > (draw_str_i18n_nbr / 2))
{
- blf_font_draw_buffer(font, draw_str[i], (size_t)draw_str_i18n_nbr, NULL);
+ blf_font_draw_buffer(font, draw_str[i], strlen(draw_str[i]), NULL);
}
else {
blf_font_draw_buffer(font, draw_str_i18n, draw_str_i18n_len, NULL);
}
}
+ blf_draw_buffer__end();
blf_font_free(font);
}