Author Topic: CodeBlocks' font is quite blur compare with other applications under Windows 7  (Read 807 times)

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 4902
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Hi, I have a new Windows 7 PC, and I just copy a C::B installation(in-fact, I use a portable C::B launcher)
But the font in C::B is blue, see the screen shot below, other applications don't have this issue, see another screen shot of Spyder IDE.
Both the C::B and Spyder using the same font, that is called "Consolas" in the editor. But I see that C::B's font in either Menu bar or inside editor are all blur. Only the C::B's title bar show some clean font texts.
Any ideas?

C::B under Windows 7 64bit



Other application


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 ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 4902
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Maybe this is related:windows - Blurry text on wxWidgets controls - Stack Overflow, my screen is 1920x1080.
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 sodev

  • Multiple posting newcomer
  • *
  • Posts: 58
No its not, that problem is about HiDPI scaling that Windows 8 and onwards do on certain zoom levels. Have you ClearType turned on? Have you set a custom zoom level, maybe even the Windows XP style one?

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 4902
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
No its not, that problem is about HiDPI scaling that Windows 8 and onwards do on certain zoom levels. Have you ClearType turned on?
Thanks.
I think I have ClearType feature turned on. (It is enabled by default?, since It's a new notebook)

Quote
Have you set a custom zoom level, maybe even the Windows XP style one?
I have no zoom level. It looks like the text inside the editor and in the Menu bar are all blurry, so this should not caused by zoom level.

What's the Windows XP style means? I have a file named "codeblocks.exe.manifest" along with codeblocks.exe which is used to solved an issue of wxListCtrl under Windows XP. But now, remove this file does not solve any issue.

All my testing environment is the latested nightly build version released March 01 in 2017.
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 sodev

  • Multiple posting newcomer
  • *
  • Posts: 58
My bet was since wxWidgets 2.8 is quite ancient these functions might cause some problems so you could try to disable them. When you set a custom zoom level in Windows 7 there is the option to do it like Windows XP, thats what i was referring to.

Where have you got this .manifest file from? You need this e.g. for enabling Themed Controls so that your Buttons and Lists dont look like from Windows 95 but usually this file gets embedded into the .exe file, you dont need an extra one. I never used a nightly, i always compile myself, cant remember having seen that file in the output ever, but cant check right now to be sure. What happens when you remove the file?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 9880
<debugger plugin maintainer>
(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 ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 4902
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Follow this page: How to Tweak ClearType in Windows for Better Screen Readability, I see that my ClearType feature is ON, I just try to disable this feature, and I found that the font get more blur, so bad :(

Check this commit: https://sourceforge.net/p/codeblocks/code/10954/
I looked at this commit, and I see that some manifest option is adjusted, but I think this manifest file is build into the codeblocks.exe, so that I have no idea how to adjust it, or maybe I have to rebuild cb?

My bet was since wxWidgets 2.8 is quite ancient these functions might cause some problems so you could try to disable them. When you set a custom zoom level in Windows 7 there is the option to do it like Windows XP, thats what i was referring to.

Where have you got this .manifest file from? You need this e.g. for enabling Themed Controls so that your Buttons and Lists dont look like from Windows 95 but usually this file gets embedded into the .exe file, you dont need an extra one. I never used a nightly, i always compile myself, cant remember having seen that file in the output ever, but cant check right now to be sure. What happens when you remove the file?
Under Windows XP, the external .manifest file has more precedence(but under Win7 and later Windows version, the embedded manifest has more precedence), so I put this file there to force C::B to use a more modern common control, so that the wxListBook shows correctly. See discussion here:Bad icons of C::B in the 16.01 release
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 oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 9880
I looked at this commit, and I see that some manifest option is adjusted, but I think this manifest file is build into the codeblocks.exe, so that I have no idea how to adjust it, or maybe I have to rebuild cb?
You'll probably have to revert it, build  against wx3.1 and start fixing things.
This commit is just a workaround for no HiDPI support in wx/cb.
You can try Biplap's wx3.1 builds to see if things are better there.
Probably there is a tool that can be use to replace the manifest in an executable. But I'm a linux dev, so I have not much experience in developing on windows.
<debugger plugin maintainer>
(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 ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 4902
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
You can try Biplap's wx3.1 builds to see if things are better there.
I just download his builds, and it font's show quite clean in his builds, great! So, 64bit C::B + wx3.02 works OK.
But my personal builds 32 bit C::B + wx 3.1 works badly.
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 stahta01

  • Lives here!
  • ****
  • Posts: 5711
    • My Best Post
You can try Biplap's wx3.1 builds to see if things are better there.
I just download his builds, and it font's show quite clean in his builds, great! So, 64bit C::B + wx3.02 works OK.
But my personal builds 32 bit C::B + wx 3.1 works badly.

Might be the difference between Mingw32 and Mingw64 based compilers being used.

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

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 4902
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
You can try Biplap's wx3.1 builds to see if things are better there.
I just download his builds, and it font's show quite clean in his builds, great! So, 64bit C::B + wx3.02 works OK.
But my personal builds 32 bit C::B + wx 3.1 works badly.

Might be the difference between Mingw32 and Mingw64 based compilers being used.

Tim S.
Hi, Tim, my personal builds 32 bit C::B and wx 3.1 were using MinGW64's MinGW-Build GCC 5.4 version.
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 ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 4902
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Check this commit: https://sourceforge.net/p/codeblocks/code/10954/
Hi, oBFusCATed, it looks like this commit(the commit is pushed by Morten in 2016-12-29) cause such issue.

I just download the previous nightly build version which is: The 20 November 2016 build (10922) is out., I don't see the blur font issue.
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 oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 9880
Of course the commit by Morten causes blurring. If you read what this flag does you would have known it without the need for testing. :)
<debugger plugin maintainer>
(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 ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 4902
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Of course the commit by Morten causes blurring. If you read what this flag does you would have known it without the need for testing. :)
Well, the strange thing is, I use a resource editor to change the embeded manifest file of the codeblocks.exe, and change the value from "False" to "True/PM", and it looks like the changed C::B is still blur. :(
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 sodev

  • Multiple posting newcomer
  • *
  • Posts: 58
Because you are on Windows 7 and there is no HiDPI scaling, this setting does nothing on your system ;)

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 4902
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Because you are on Windows 7 and there is no HiDPI scaling, this setting does nothing on your system ;)

Hi, here is the good news, when reboot my computer, and now start the modified C::B(change the manifest file of codeblocks.exe to revert the commit 10954), then the font is clean now. Maybe Windows 7 just caches the codeblocks.exe? Or the option "True/PM" has some side effects.  :)
« Last Edit: March 06, 2017, 12:59:04 am by ollydbg »
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 sodev

  • Multiple posting newcomer
  • *
  • Posts: 58
Looks like i was wrong, High DPI scaling exists since Windows Vista, Windows 8 just changed how it works and added the Per-Monitor option. Strange that MSDN lists these settings to work only on Windows 8.1 onwards. So these settings do something for you as well :). I was just confused how good CodeBlocks looks for you, im on Windows 10 and if scaling is used there it looks much more worse.

But now the really confusing part is, reverting that mentioned commit marks the program non-DPI-Aware and actually ENABLES the scaling so it should look worse :o! I am on Windows 10 and face the problem that a lot of programs look really bad because they don't mark themself as DPI-Aware so the scaling is enabled and i have to DISABLE the scaling for them.

To disable the scaling at least on Windows 10 there is an easier option than editing the manifest. In the Properties dialog of the .exe file on the tab Compatibility Settings (don't know the exact wording, i don't have an english Windows) there is the option to disable DPI scaling, this does the same like marking the program DPI-Aware through the manifest. I don't know if Windows 7 has the same setting that does the same magic.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 4902
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
I'm really confused about this option. It looks like under Win10, you need the option: <dpiAware>False</dpiAware>. While under Win7, I need the option <dpiAware>True/PM</dpiAware>.
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 sodev

  • Multiple posting newcomer
  • *
  • Posts: 58
Hmm, apparently reading is not my thing today. Mortens commit set the value to False, reverting that turns it back to True/PM and thats what we both need. I messed that up in my last post, but now everything makes sense for me :).

<dpiAware>True/PM</dpiAware> -> Application is DPI-Aware, scaling DISABLED
<dpiAware>False</dpiAware> -> Application is NOT DPI-Aware, scaling ENABLED

The problem with scaling DISABLED is that icons and other resources stay small while text gets bigger if the zoom factor is bigger than 100%, that might cause some layout issues if you use the size of the icons as constraint. The problem with scaling ENABLED is that text looks blurry (actually icons too because everything gets bitmap scaled, but blurry icons are not so noticeable than blurry text).