Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Font of "Tools output" tab #550

Open
melkorbsd opened this issue Dec 20, 2024 · 3 comments
Open

Font of "Tools output" tab #550

melkorbsd opened this issue Dec 20, 2024 · 3 comments

Comments

@melkorbsd
Copy link
Contributor

melkorbsd commented Dec 20, 2024

The "Tools output" tab (txtToolsOutput widget) requires a monospaced font to position compiler errors correctly.

Otherwise, it turns out like this:

изображение

And it should be like this:

изображение

If I change to the monospaced font of the entire application, the tab font changes and the offset problem disappears. Maybe it is better to synchronize the font of this tab with the monospaced font of the editor?

PS: In addition, there is clearly a problem with encodings. Probably, it is a matter of converting from editor encoding (UTF-8) to executable file encoding (CP866), and the opposite conversion is needed when outputting compiler messages.

PS2: As it turned out, the problem is not in the reverse translation of the encoding, but in the fact that the contents of the tab contain the correct text in UTF-8 encoding, but it is displayed as CP1251 (System default codepage). This is how "Привет" turned out to be "Привет"

@royqh1979
Copy link
Owner

An option to set tools output panel font would be useful, but not much. Most of time we just check compile warnings and errors in the compiler info panel, and seldom need to align the text in the tools output panel.

As for the encoding problem, it seems that there's something wrong in the compiler detection procedure. What's the the output of gcc -v?

@melkorbsd
Copy link
Contributor Author

An option to set tools output panel font would be useful, but not much. Most of time we just check compile warnings and errors in the compiler info panel, and seldom need to align the text in the tools output panel.

In this case, it is an opportunity to get additional information about errors.

As for the encoding problem, it seems that there's something wrong in the compiler detection procedure. What's the the output of gcc -v?

Using built-in specs.
COLLECT_GCC=C:\Program Files\RedPanda-Cpp\mingw64\bin\gcc.exe
COLLECT_LTO_WRAPPER=C:/Program\ Files/RedPanda-Cpp/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/11.4.0/lto-wrapper.exe
Target: x86_64-w64-mingw32
Configured with: ../../../src/gcc-11.4.0/configure --host=x86_64-w64-mingw32 --build=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --prefix=/mingw64 --with-sysroot=/i/mingw-builds/x86_64-1140-posix-seh-msvcrt-rt_v11/mingw64 --enable-host-shared --disable-multilib --enable-languages=c,c++,lto --enable-libstdcxx-time=yes --enable-threads=posix --enable-libgomp --enable-libatomic --enable-lto --enable-graphite --enable-checking=release --enable-fully-dynamic-string --enable-version-specific-runtime-libs --enable-libstdcxx-filesystem-ts=yes --disable-libstdcxx-pch --disable-libstdcxx-debug --enable-bootstrap --disable-rpath --disable-win32-registry --disable-nls --disable-werror --disable-symvers --with-gnu-as --with-gnu-ld --with-arch=nocona --with-tune=core2 --with-libiconv --with-system-zlib --with-gmp=/i/mingw-builds/prerequisites/x86_64-w64-mingw32-static --with-mpfr=/i/mingw-builds/prerequisites/x86_64-w64-mingw32-static --with-mpc=/i/mingw-builds/prerequisites/x86_64-w64-mingw32-static --with-isl=/i/mingw-builds/prerequisites/x86_64-w64-mingw32-static --with-pkgversion='x86_64-posix-seh, Built by MinGW-Builds project' --with-bugurl=https://github.com/niXman/mingw-builds CFLAGS='-O2 -pipe -fno-ident -I/i/mingw-builds/x86_64-1140-posix-seh-msvcrt-rt_v11/mingw64/opt/include -I/i/mingw-builds/prerequisites/x86_64-zlib-static/include -I/i/mingw-builds/prerequisites/x86_64-w64-mingw32-static/include' CXXFLAGS='-O2 -pipe -fno-ident -I/i/mingw-builds/x86_64-1140-posix-seh-msvcrt-rt_v11/mingw64/opt/include -I/i/mingw-builds/prerequisites/x86_64-zlib-static/include -I/i/mingw-builds/prerequisites/x86_64-w64-mingw32-static/include' CPPFLAGS=' -I/i/mingw-builds/x86_64-1140-posix-seh-msvcrt-rt_v11/mingw64/opt/include -I/i/mingw-builds/prerequisites/x86_64-zlib-static/include -I/i/mingw-builds/prerequisites/x86_64-w64-mingw32-static/include' LDFLAGS='-pipe -fno-ident -L/i/mingw-builds/x86_64-1140-posix-seh-msvcrt-rt_v11/mingw64/opt/lib -L/i/mingw-builds/prerequisites/x86_64-zlib-static/lib -L/i/mingw-builds/prerequisites/x86_64-w64-mingw32-static/lib ' LD_FOR_TARGET=/i/mingw-builds/x86_64-1140-posix-seh-msvcrt-rt_v11/mingw64/bin/ld.exe --with-boot-ldflags=' -Wl,--disable-dynamicbase -static-libstdc++ -static-libgcc'
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 11.4.0 (x86_64-posix-seh, Built by MinGW-Builds project)

@CyanoHao
Copy link
Contributor

The encoding problem:
In diagnostic message, GCC converts file names and error messages (if NLS enabled) to ACP (or OEMCP, I'm not sure), but keeps file content as-is, no conversion applied.

There are no good ways to read a stream in mixed encodings. The file names and error messages are much more important, while file content can be easily located in editor window. So Red Panda C++ decodes it with GCC's ACP.

I believe it won't be a problem in near future. Since GCC 13, UTF-8 manifest is applied by default, and diagnostic messages are purely UTF-8. After switching to mingw-lite GCC 14, everything will work well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants