diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-10-20 14:47:38 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-10-20 14:47:38 +0400 |
commit | 3d501ca70fb3811ced1fdad5e4a170d173531a94 (patch) | |
tree | a17c8f42e98e4d977a61a93c13bfb6bf13f5eccb | |
parent | 70ba7d02dbb44a20ac6d405d75e81806fc7ce4b5 (diff) |
unicode text input for 3d text.
-rw-r--r-- | source/blender/blenlib/BLI_string_utf8.h | 2 | ||||
-rw-r--r-- | 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]; |