Code::Blocks Forums

User forums => Help => Topic started by: ollydbg on March 05, 2017, 03:41:41 am

Title: CodeBlocks' font is quite blur compare with other applications under Windows 7
Post by: ollydbg on March 05, 2017, 03:41:41 am
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

(http://i683.photobucket.com/albums/vv194/ollydbg_cb/cb_blur_font_zps2ifgnvk0.png)

Other application

(http://i683.photobucket.com/albums/vv194/ollydbg_cb/other_app_zps3eet6oss.png)
Title: Re: CodeBlocks' font is quite blur compare with other applications under Windows 7
Post by: ollydbg on March 05, 2017, 04:33:43 am
Maybe this is related:windows - Blurry text on wxWidgets controls - Stack Overflow (http://stackoverflow.com/questions/38626185/blurry-text-on-wxwidgets-controls), my screen is 1920x1080.
Title: Re: CodeBlocks' font is quite blur compare with other applications under Windows 7
Post by: sodev on March 05, 2017, 05:02:33 am
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?
Title: Re: CodeBlocks' font is quite blur compare with other applications under Windows 7
Post by: ollydbg on March 05, 2017, 05:23:00 am
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.
Title: Re: CodeBlocks' font is quite blur compare with other applications under Windows 7
Post by: sodev on March 05, 2017, 06:35:46 am
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?
Title: Re: CodeBlocks' font is quite blur compare with other applications under Windows 7
Post by: oBFusCATed on March 05, 2017, 09:44:37 am
Check this commit: https://sourceforge.net/p/codeblocks/code/10954/
Title: Re: CodeBlocks' font is quite blur compare with other applications under Windows 7
Post by: ollydbg on March 05, 2017, 11:06:09 am
Follow this page: How to Tweak ClearType in Windows for Better Screen Readability (https://www.howtogeek.com/howto/28790/tweak-cleartype-in-windows-7/), 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 (http://forums.codeblocks.org/index.php/topic,20871.msg142502.html#msg142502)
Title: Re: CodeBlocks' font is quite blur compare with other applications under Windows 7
Post by: oBFusCATed on March 05, 2017, 12:06:51 pm
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.
Title: Re: CodeBlocks' font is quite blur compare with other applications under Windows 7
Post by: ollydbg on March 05, 2017, 12:37:23 pm
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.
Title: Re: CodeBlocks' font is quite blur compare with other applications under Windows 7
Post by: stahta01 on March 05, 2017, 01:09:13 pm
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.
Title: Re: CodeBlocks' font is quite blur compare with other applications under Windows 7
Post by: ollydbg on March 05, 2017, 02:36:15 pm
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.
Title: Re: CodeBlocks' font is quite blur compare with other applications under Windows 7
Post by: ollydbg on March 05, 2017, 03:21:33 pm
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. (http://forums.codeblocks.org/index.php/topic,21556.0.html), I don't see the blur font issue.
Title: Re: CodeBlocks' font is quite blur compare with other applications under Windows 7
Post by: oBFusCATed on March 05, 2017, 03:33:58 pm
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. :)
Title: Re: CodeBlocks' font is quite blur compare with other applications under Windows 7
Post by: ollydbg on March 05, 2017, 03:56:06 pm
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. :(
Title: Re: CodeBlocks' font is quite blur compare with other applications under Windows 7
Post by: sodev on March 05, 2017, 08:27:49 pm
Because you are on Windows 7 and there is no HiDPI scaling, this setting does nothing on your system ;)
Title: Re: CodeBlocks' font is quite blur compare with other applications under Windows 7
Post by: ollydbg on March 06, 2017, 12:52:33 am
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.  :)
Title: Re: CodeBlocks' font is quite blur compare with other applications under Windows 7
Post by: sodev on March 06, 2017, 12:57:50 pm
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.
Title: Re: CodeBlocks' font is quite blur compare with other applications under Windows 7
Post by: ollydbg on March 06, 2017, 02:32:15 pm
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>.
Title: Re: CodeBlocks' font is quite blur compare with other applications under Windows 7
Post by: sodev on March 06, 2017, 03:03:37 pm
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).