Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: ollydbg on October 22, 2020, 02:11:43 pm

Title: Text alignment error in C::B editor
Post by: ollydbg on October 22, 2020, 02:11:43 pm
Hi, it looks like C::B's editor can't measure the Chinese character correctly, so that I can't make the comment get alignment, this does not happen in Notepad++'s editor.

See the image shot below for comparing.

Any ideas? I have set the same font "Courier New, size 10" in those two editors. Note a normal Chinese character is double width of a normal English character.
Title: Re: Text alignment error in C::B editor
Post by: oBFusCATed on October 23, 2020, 07:40:21 pm
Have you enabled ligature support in one or the other? What about the latest STC sample in wxWidgets?
Title: Re: Text alignment error in C::B editor
Post by: ollydbg on October 24, 2020, 02:55:44 am
Have you enabled ligature support in one or the other?
I just tested it, under C::B, the alignment issue happens in both normal mode or ligature mode.
Under Notepad++, I only use the normal mode, and it does not have such alignment issue.


Quote
What about the latest STC sample in wxWidgets?
I haven't tried it yet. Will try it if I have more time.
Title: Re: Text alignment error in C::B editor
Post by: oBFusCATed on October 24, 2020, 10:06:17 am
If you overlay the images in gimp/photoshop you'll see that font rendering is totally different. I don't know why.
Title: Re: Text alignment error in C::B editor
Post by: ollydbg on November 07, 2020, 12:48:24 pm
OK, I find the reason of this issue.

This issue also happens in the latest Notepad++.

The problem is that a bold Chinese font is a bit wider than a normal Chinese font.

Under C::B, when the Chinese character is after the
Code
///
, which means it's a doxygen style comment, it will be bold, and this issue happens. If I set the doxygen comment font style to bold font, this issue also happens under Notepad++.

I'm not sure how I can solve this.  :(