diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2013-02-20 12:39:31 +0400 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2013-02-20 12:39:31 +0400 |
commit | 5d04d06d76f0f48c0bc42c223b204b062938df04 (patch) | |
tree | 97eaa815f508c01fee72054c04be4da0f604d8f5 | |
parent | 7f8d597c7983ed9d196402fc441ba510414e0c0f (diff) |
Fix drawing of translated strings (can't use _ascii version of BLF_draw in these cases, when WITH_INTERNATIONAL is defined we need unicode support).
-rw-r--r-- | source/blender/editors/space_view3d/view3d_draw.c | 17 | ||||
-rw-r--r-- | source/blender/editors/transform/transform.c | 4 |
2 files changed, 19 insertions, 2 deletions
diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index a34b4c5157b..4aaa3332252 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -854,8 +854,13 @@ static void draw_viewport_name(ARegion *ar, View3D *v3d, rcti *rect) { RegionView3D *rv3d = ar->regiondata; const char *name = view3d_get_name(v3d, rv3d); + /* XXX 24 may be a bit small for unicode languages (Chinese in utf-8...) */ +#ifdef WITH_INTERNATIONAL + char tmpstr[32]; +#else char tmpstr[24]; - +#endif + if (v3d->localvd) { BLI_snprintf(tmpstr, sizeof(tmpstr), IFACE_("%s (Local)"), name); name = tmpstr; @@ -863,7 +868,11 @@ static void draw_viewport_name(ARegion *ar, View3D *v3d, rcti *rect) if (name) { UI_ThemeColor(TH_TEXT_HI); +#ifdef WITH_INTERNATIONAL + BLF_draw_default(U.widget_unit + rect->xmin, rect->ymax - U.widget_unit, 0.0f, name, sizeof(tmpstr)); +#else BLF_draw_default_ascii(U.widget_unit + rect->xmin, rect->ymax - U.widget_unit, 0.0f, name, sizeof(tmpstr)); +#endif } } @@ -2854,8 +2863,12 @@ static void draw_viewport_fps(Scene *scene, rcti *rect) UI_ThemeColor(TH_TEXT_HI); BLI_snprintf(printable, sizeof(printable), IFACE_("fps: %i"), (int)(fps + 0.5f)); } - + +#ifdef WITH_INTERNATIONAL + BLF_draw_default(rect->xmin + U.widget_unit, rect->ymax - U.widget_unit, 0.0f, printable, sizeof(printable)); +#else BLF_draw_default_ascii(rect->xmin + U.widget_unit, rect->ymax - U.widget_unit, 0.0f, printable, sizeof(printable)); +#endif } static void view3d_main_area_draw_objects(const bContext *C, ARegion *ar, const char **grid_unit); diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index 1a7a425fbc9..ea82ebb9234 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -1686,7 +1686,11 @@ static void drawAutoKeyWarning(TransInfo *UNUSED(t), ARegion *ar) * - original color was red to match the icon, but that clashes badly with a less nasty border */ UI_ThemeColorShade(TH_TEXT_HI, -50); +#ifdef WITH_INTERNATIONAL + BLF_draw_default(xco, ar->winy - 17, 0.0f, printable, sizeof(printable)); +#else BLF_draw_default_ascii(xco, ar->winy - 17, 0.0f, printable, sizeof(printable)); +#endif /* autokey recording icon... */ glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); |