Author Topic: [SOLVED] Code::Blocks 17.12 blurry text on Windows  (Read 30227 times)

Offline aGerman

  • Single posting newcomer
  • *
  • Posts: 9
[SOLVED] Code::Blocks 17.12 blurry text on Windows
« on: January 02, 2018, 12:14:50 am »
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.
« Last Edit: January 06, 2018, 08:05:59 pm by aGerman »

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Code::Blocks 17.12 blurry text on Windows
« Reply #1 on: January 02, 2018, 12:21:38 am »
Is your monitor high DPI?

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

Offline aGerman

  • Single posting newcomer
  • *
  • Posts: 9
Re: Code::Blocks 17.12 blurry text on Windows
« Reply #2 on: January 02, 2018, 12:43:42 am »
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
« Last Edit: January 02, 2018, 12:52:24 am by aGerman »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Code::Blocks 17.12 blurry text on Windows
« Reply #3 on: January 02, 2018, 01:11:11 am »
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!]

Offline aGerman

  • Single posting newcomer
  • *
  • Posts: 9
Re: Code::Blocks 17.12 blurry text on Windows
« Reply #4 on: January 02, 2018, 01:24:34 am »
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

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Code::Blocks 17.12 blurry text on Windows
« Reply #5 on: January 02, 2018, 03:04:46 pm »
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.

Offline aGerman

  • Single posting newcomer
  • *
  • Posts: 9
Re: Code::Blocks 17.12 blurry text on Windows
« Reply #6 on: January 02, 2018, 04:21:55 pm »
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

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Code::Blocks 17.12 blurry text on Windows
« Reply #7 on: January 02, 2018, 05:28:20 pm »
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.
« Last Edit: January 02, 2018, 05:43:02 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline aGerman

  • Single posting newcomer
  • *
  • Posts: 9
Re: Code::Blocks 17.12 blurry text on Windows
« Reply #8 on: January 02, 2018, 05:49:37 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

Offline aGerman

  • Single posting newcomer
  • *
  • Posts: 9
Re: Code::Blocks 17.12 blurry text on Windows
« Reply #9 on: January 02, 2018, 09:25:14 pm »
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
Code
@set "__COMPAT_LAYER=~ HIGHDPIAWARE" & start "" /max "codeblocks.exe"
Save it in the same folder along with codeblocks.exe and run this script instead.

Steffen
« Last Edit: January 02, 2018, 09:28:05 pm by aGerman »

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Code::Blocks 17.12 blurry text on Windows
« Reply #10 on: January 02, 2018, 09:54:32 pm »
Thank you for sharing this solution !  :)

Offline aGerman

  • Single posting newcomer
  • *
  • Posts: 9
Re: Code::Blocks 17.12 blurry text on Windows
« Reply #11 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

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Code::Blocks 17.12 blurry text on Windows
« Reply #12 on: January 03, 2018, 03:23:52 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:

Code
@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.

Offline aGerman

  • Single posting newcomer
  • *
  • Posts: 9
Re: Code::Blocks 17.12 blurry text on Windows
« Reply #13 on: January 03, 2018, 03:57:04 pm »
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

Offline santanugh

  • Single posting newcomer
  • *
  • Posts: 2
Re: [SOLVED] Code::Blocks 17.12 blurry text on Windows
« Reply #14 on: November 04, 2018, 06:19:43 am »
The trick of override dpi worked thanks......