From 5792e77239c43aea0afc21b2df96153ba31c5399 Mon Sep 17 00:00:00 2001 From: Irie Shinsuke Date: Tue, 12 Mar 2013 07:25:53 +0000 Subject: Patch [#34373] Use i18n monospace font in Text editor and Python console This patch allows Blender to display i18n monospace font in the text editor and the Python interactive console. Wide characters that occupy multiple columns such as CJK characters can be displayed correctly. Furthermore, wrapping, selection, suggestion, cursor drawing, and syntax highlighting should work. Also fixes a bug [#34543]: In Text Editor false color in comment on cyrillic To estimate how many columns each character occupies, this patch uses wcwidth.c written by Markus Kuhn and distributed under MIT-style license: http://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c wcwidth.c is stored in extern/wcwidth and used as a static library. This patch adds new API to blenfont, blenlib and blenkernel: BLF_get_unifont_mono() BLF_free_unifont_mono() BLF_draw_mono() BLI_wcwidth() BLI_wcswidth() BLI_str_utf8_char_width() BLI_str_utf8_char_width_safe() txt_utf8_offset_to_column() txt_utf8_column_to_offset() --- extern/wcwidth/SConscript | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 extern/wcwidth/SConscript (limited to 'extern/wcwidth/SConscript') diff --git a/extern/wcwidth/SConscript b/extern/wcwidth/SConscript new file mode 100644 index 00000000000..14fdaf3f738 --- /dev/null +++ b/extern/wcwidth/SConscript @@ -0,0 +1,9 @@ +#!/usr/bin/python + +Import('env') + +sources = env.Glob('*.c') + +incs = '.' + +env.BlenderLib ( 'extern_wcwidth', sources, Split(incs), [], libtype=['extern','player'], priority=[10, 185]) -- cgit v1.2.3