raddebugger icon indicating copy to clipboard operation
raddebugger copied to clipboard

cpp, Simplified Chinese garbled

Open fairycn opened this issue 1 year ago • 7 comments

cpp, Simplified Chinese garbled As shown in the following figure when there is Simplified Chinese in the code, the relevant characters cannot be displayed normally image

fairycn avatar May 27 '24 02:05 fairycn

Looks like the font doesn't support Chinese glyphs and the font renderer doesn't fallback. Does it work if you change to a font with Chinese glyphs in it?

ske2004 avatar May 27 '24 06:05 ske2004

The software does not find a place to configure the font options, can you tell me how to configure it, I'll test it on my side.

fairycn avatar May 27 '24 07:05 fairycn

Open %appdata%/raddbg/default.raddbg_user and scroll to

/// fonts /////////////////////////////////////////////////////////////////////

code_font: ""
main_font: ""

You can place a .ttf font file in %appdata%/raddbg/ and reference it like code_font: "my_font.ttf"

I was able to render "你好" using BabelStoneHan.ttf, but that is not a proper programming font.

bielok avatar May 27 '24 13:05 bielok

Thank you, to pass this method to solve the font display problem, but found that the code file in the first line more than an unknown character (not caused by the font file, you can refer to the previous picture, not set the body of the code file at the beginning of the contents of the content compared to the source code more than some of the content.) image EF BB BF image

fairycn avatar May 28 '24 02:05 fairycn

I am having trouble understanding what you are saying in English!

Could you try DeepL or some LLM (ChatGPT or similar) to help clarify the translation?

My understanding is that you are noticing 3 unexpected characters rendered as boxes right before the comment on line 1, that is, EF BB BF which is the UTF-8 Byte Order Mark (BOM). I believe you can save your files with a different encoding, without BOM, to stop those characters from showing up. This may help for VSCode.

Having said that, better handling of BOM in the debugger would be good. If my understanding of the remaining problem is correct we should perhaps track it in a different issue, as other encoding nuances may arise.

bielok avatar May 28 '24 02:05 bielok

Yes, it means what you understand it to mean (the code file is generated by the vs 2022 default settings)

fairycn avatar May 31 '24 05:05 fairycn

Feature request: It would be nice if there were some way to set the font via the UI, and preferably choose from the standard list of installed fonts on Windows. Having to find a config file and copy the .ttf there manually was not easy to discover.

dbechrd avatar Sep 05 '24 20:09 dbechrd