Patch [#34373] Use i18n monospace font in Text editor and Python console
authorIrie Shinsuke <irieshinsuke@yahoo.co.jp>
Tue, 12 Mar 2013 07:25:53 +0000 (07:25 +0000)
committerIrie Shinsuke <irieshinsuke@yahoo.co.jp>
Tue, 12 Mar 2013 07:25:53 +0000 (07:25 +0000)
commit5792e77239c43aea0afc21b2df96153ba31c5399
tree47eb20f56f932f984800329781f2e75e38e7eb78
parent6669ee4784ac6591711298eb01f8e0b06793c60a
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()
27 files changed:
extern/CMakeLists.txt
extern/SConscript
extern/wcwidth/CMakeLists.txt [new file with mode: 0644]
extern/wcwidth/SConscript [new file with mode: 0644]
extern/wcwidth/wcwidth.c [new file with mode: 0644]
extern/wcwidth/wcwidth.h [new file with mode: 0644]
source/blender/blenfont/BLF_api.h
source/blender/blenfont/BLF_translation.h
source/blender/blenfont/intern/blf.c
source/blender/blenfont/intern/blf_font.c
source/blender/blenfont/intern/blf_internal.h
source/blender/blenfont/intern/blf_translation.c
source/blender/blenkernel/BKE_text.h
source/blender/blenkernel/intern/text.c
source/blender/blenlib/BLI_string_utf8.h
source/blender/blenlib/CMakeLists.txt
source/blender/blenlib/SConscript
source/blender/blenlib/intern/string_utf8.c
source/blender/editors/interface/interface_style.c
source/blender/editors/space_console/console_draw.c
source/blender/editors/space_info/textview.c
source/blender/editors/space_text/text_draw.c
source/blender/editors/space_text/text_ops.c
source/blender/windowmanager/intern/wm_init_exit.c
source/blenderplayer/CMakeLists.txt
source/creator/CMakeLists.txt
source/gameengine/GamePlayer/ghost/GPG_ghost.cpp