[Lazarus] 0.925 editor of the Chinese characters overlap

Martin Friebe lazarus at mfriebe.de
Tue Oct 28 11:53:45 CET 2008


Hi,

For the display (Synedit) issue another workaround exists, if you are 
willing to patch your Lazarus yourself.

The full issue is known under http://bugs.freepascal.org/view.php?id=11819
While it will be unfortunately sometime until I get to do a proper fix 
for this, a patch is attached to the bug, which allows to view chinese 
chars.
It seems stable, and worked for the examples I had. If you find more 
double-wide ranges you can add them easily.

The reason it has not been added to Lazarus as it stands is that the 
code is a very simple hack. Which would make the maintenance of Lazarus 
harder for everyone else.

It also has one side effect/bug. The cursor steps in single wide chars. 
So the cursor can be positioned in the middle of a chinese char, and 
then may act either as if it was before, or it was after the char.

Regards
Martin


peng wrote:
> Now the situation is:
>       Lazarus 0.926 on Windows XP chinese (zh_CN) . Chinese characters
> overlap in editor,
> Temporary solution is here:
>       Environment》Editor Options…》Display》Default editor font… (change
> other font).
>
> The ScreenPrint can see here: http://pengtu.net/wp2/pc/lazarus-0926-zh
>
> The issue will affect the matter: Chinese notes in code, or some of
> the Caption, or showmessage string, etc.
>
> thanks
>
> 2008/6/24 Mattias Gärtner <nc-gaertnma at netcologne.de>:
>   
>> They overlap even more.
>> Synedit only supports monospace fonts (every character has the same width).
>> The bug was, that a 3 byte chinese character was *painted* three times as wide
>> as other characters. But the rest of synedit treated a 3 byte chinese charater
>> correctly as one visible character. So caret position and painted characters
>> were out of sync. This has been fixed.
>>
>> But:
>> In all fonts I tried under ubuntu/linux/gtk2 the chinese characters are much
>> wider than the others, so they all look bad in synedit.
>>
>> I added in svn 15559 the synedit property ExtraCharSpacing. You can set it in
>> the editor options of the IDE. This is merely a workaround, so that it is at
>> least usable. It would be better to extend synedit to support proportional
>> fonts, but this is a big task.
>>
>>
>> BTW, the IDE can not yet convert files written in 2byte windows codepage.
>> Do you know, if there are actually any sources written in 2byte windows
>> codepage?
>> If yes, then converter functions must be implemented in lcl/lconvencoding.pas. I
>> can do that if needed.
>> Mattias
>>     
>
>   



More information about the Lazarus mailing list