User forums > Using Code::Blocks

Text alignment error in C::B editor

(1/1)

ollydbg:
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.

oBFusCATed:
Have you enabled ligature support in one or the other? What about the latest STC sample in wxWidgets?

ollydbg:

--- Quote from: oBFusCATed on October 23, 2020, 07:40:21 pm ---Have you enabled ligature support in one or the other?

--- End quote ---
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?
--- End quote ---
I haven't tried it yet. Will try it if I have more time.

oBFusCATed:
If you overlay the images in gimp/photoshop you'll see that font rendering is totally different. I don't know why.

ollydbg:
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: ---///
--- End 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.  :(

Navigation

[0] Message Index

Go to full version