From 3d501ca70fb3811ced1fdad5e4a170d173531a94 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 20 Oct 2011 10:47:38 +0000 Subject: unicode text input for 3d text. --- source/blender/blenlib/BLI_string_utf8.h | 2 +- source/blender/editors/curve/editfont.c | 16 ++++++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/source/blender/blenlib/BLI_string_utf8.h b/source/blender/blenlib/BLI_string_utf8.h index 15884c4d2d9..b7a9c204bfe 100644 --- a/source/blender/blenlib/BLI_string_utf8.h +++ b/source/blender/blenlib/BLI_string_utf8.h @@ -25,7 +25,7 @@ #ifndef BLI_STRING_UTF8_H #define BLI_STRING_UTF8_H -/** \file BLI_string.h +/** \file BLI_string_utf8.h * \ingroup bli */ diff --git a/source/blender/editors/curve/editfont.c b/source/blender/editors/curve/editfont.c index 03e226e3a75..dff5be059c3 100644 --- a/source/blender/editors/curve/editfont.c +++ b/source/blender/editors/curve/editfont.c @@ -1291,8 +1291,20 @@ static int insert_text_invoke(bContext *C, wmOperator *op, wmEvent *evt) if(val && ascii) { /* handle case like TAB (== 9) */ - if((ascii > 31 && ascii < 254 && ascii != 127) || (ascii==13) || (ascii==10) || (ascii==8)) { - if(accentcode) { + if( (ascii > 31 && ascii < 254 && ascii != 127) || + (ascii==13) || + (ascii==10) || + (ascii==8) || + (evt->utf8_buf[0])) + { + + if (evt->utf8_buf[0]) { + BLI_strncpy_wchar_from_utf8(inserted_text, evt->utf8_buf, 1); + ascii= inserted_text[0]; + insert_into_textbuf(obedit, ascii); + accentcode= 0; + } + else if(accentcode) { if(cu->pos>0) { inserted_text[0]= findaccent(ef->textbuf[cu->pos-1], ascii); ef->textbuf[cu->pos-1]= inserted_text[0]; -- cgit v1.2.3