Please find attached a modified FastColoredTextBox text editor for CJK characters. The functional changes are very simple but it's a huge change in code.
In current release version and in BETA till v1.1.4.21, the CJK character handling is as follows:
Measure each character's width if it exceeds the predefined fixed character width of the current font. If the width of the character is bigger, scale down the character width and hight by a calculated factor. After that, the CJK character fits into the fixed grid and uses the place that other normal characters use. That leads to character representation with different character size. It also leads in very poor performance in Chinese and Japanese K-IDE versions.
The attached DLL changes that to the following strategy:
Instead of meassuring each character, CJK characters are identified by the character code. When a CJK character is identified, the character is expected to have a double width compared to normal characters. When drawing such characters, the space for that characters are doubled. This strategy must be kept in mind, when placing the caret with the cursor keys or the mouse and when selecting a number of characters.
If you like to test the new editor component, please replace your existing FastColoredTextBox.dll file with the attached one (after unpacking). Please keep the original dll file to revert it if the editor will do unexpected things! The changes are only relevant for people who are using CJK characters, but it effects all character sets and languages.
As always: feel free to download, install and test the new editor and leave your comments! - Thank you!