News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

[SOLVED] Code::Blocks 17.12 blurry text on Windows

Started by aGerman, January 02, 2018, 12:14:50 AM

Previous topic - Next topic

aGerman

I use Code::Blocks for years and I really like it. Today I updated to version 17.12 on my Windows 10 notebook. While the text in the title bar is still absolutely clear text inside of the window (menu items, manager, code in the editor, logs, status bar, ...) is fuzzy.
No such problems using version 16.01, no such problems in any other application. ClearType is activated (by default).
Is there any setting in Code::Blocks that I'm missing?

Tomorrow I'll have the opportunity to test on Windows 7. I'll get back with the information if version 17.12 behaves the same on that machine.

stahta01

C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

aGerman

#2
I don't think so, Tim.
It's a small 10" display (also usable as tablet touch screen) with a resolution of 1366 x 768 which makes this issue even worse ;) However the settings for font type, font size, and zoom are the same as I used for version 16.01 which I right now use for comparisons because I have it backed up. And as I said only Code::Blocks is affected.

Thanks
Steffen

Edit: screen shot snippet attached

oBFusCATed

The dpi of this machine is 156, so it is definitely high dpi (1.5 scaling factor).
At the moment cb doesn't support proper scaling and it is set to be blurry on such monitors to prevent everything becoming too tiny.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

aGerman

Thank you for your reply!
Since you obviously decided to change this behavior with the latest update you definitly force me to return to 16.01. What a shame  :(

Steffen

ollydbg

I'm using a 14in notebook, which is 1920*1080. I also feel C::B is blur, and I use this method to solve the issue. See here: Re: CodeBlocks' font is quite blur compare with other applications under Windows 7 and the whole thread for the discussion.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

aGerman

Thanks for your info, ollydbg.
Of course I searched the forum for similar threads before I opened a new topic. I also already read this thread. As I stated ClearType is activated and the rest of the linked thread is about compiling C::B by yourself. At least that's what I understood. Please correct me if I'm wrong and instead you changed the executable in a HEX editor to update these values.

Steffen

stahta01

#7
Try right clicking on the codeblocks.exe file and looking at Compatibility tab.

I suggest trying the "Override High DPI"; this is just a guess.

The thread implied the adding of an manifest file or the editing of a manifest file.
Edit: The fix was adding an external management file for Windows XP; I do not see a fix for Windows 10; but, I suggest trying the Compatibility setting above and see if it work. I am on Windows 10 32 bit; but, the fonts has looked blurry to me for years on this computer; so, I can not test any thing.

Tim S.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

aGerman

Quote from: stahta01 on January 02, 2018, 05:28:20 PM
I suggest trying the "Override High DPI"; this is just a guess.

Your guess did the trick, Tim! Thank you very much :D That'll certainly helpful for other users, too.

Steffen

aGerman

#9
Addendum for those who use Code::Blocks as portable IDE

Tim's suggestion creates a registry setting on the computer that you're currently working on.
(HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers)
That means if you run Code::Blocks e.g. from a USB pen drive on different machines (like I do) you would have to renew this setting on every computer that you're using it. To get rid of this annoying settings you can just write a batch script (ASCII text file with extension .bat instead of .txt) where you set the __COMPAT_LAYER environment variable to the value used to override High DPI and run codeblocks.exe. It's just one line of script code.

_CodeBlocks.bat
@set "__COMPAT_LAYER=~ HIGHDPIAWARE" & start "" /max "codeblocks.exe"
Save it in the same folder along with codeblocks.exe and run this script instead.

Steffen

Jenna


aGerman

I'm just trying to give something back to the forum where I've been helped :)

Steffen

ollydbg

Quote from: aGerman on January 02, 2018, 10:03:14 PM
I'm just trying to give something back to the forum where I've been helped :)

Steffen

Thanks.
In fact, I use C::B in a portable way, see the command I used for the batch file:

@set "__COMPAT_LAYER=~ HIGHDPIAWARE" & start "" /max "CbLauncher.exe"

This works nicely under Win7, so I think I don't need to use the resource editor to hack the codeblocks.exe. :)
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

aGerman

The environment is always inherited from the parent process. That way the __COMPAT_LAYER value also reaches the call of codeblocks.exe from within CbLauncher.exe.
Thanks for the feedback btw. Nice to hear that this little hack works for you, too.

Steffen

santanugh