Author Topic: Font size in "Manager" window, Projects/Resources tabs  (Read 13708 times)

Offline cacb

  • Lives here!
  • ****
  • Posts: 536
Font size in "Manager" window, Projects/Resources tabs
« on: May 24, 2021, 03:26:02 pm »
I am a long time Code::Blocks user, but have discovered an issue after upgrading to Kubuntu 20.04 and installing a new high resolution graphics card (screen resolution 2560x1440): Most things work but the fonts in the "Manager" window, containing the Projects and Resources tabs are so small they hurt my eyes...

Currently I am running Code::Blocks 20.03, installed from the Ubuntu repository.

I am aware of how to adjust the font size in the editor window, i.e. using
Settings -> Editor -> General Settings .. and then choose a font
or using Ctrl + Mouse wheel

...but these options do not affect the font size elsewhere. I see the font issue in the "Manager" window and also in the Logs & Others below.

Question: Is there a way to adjust the relevant font sizes in Code::Blocks 20.03 ?

If building from source fixes the issue, I can also do that. Please advice.


Offline cacb

  • Lives here!
  • ****
  • Posts: 536
Re: Font size in "Manager" window, Projects/Resources tabs
« Reply #1 on: May 24, 2021, 05:00:04 pm »
Well, I found a work-around. It is not perfect, but more acceptable to my eyes.

As noted, with the new graphics card I had a screen resolution of 2560x1440. I had also set the KDE font size in Settings -> System Settings -> Fonts  -> Force font DPI 120.  This generally gave good font sizes in all applications, but not in C::B. It also had a side effect in C::B 20.03 in that the compiler tab didn't show the current build target name unless the Compiler tab was deactivated and then reactivated (had to be done each time C::B was started).

So the work-around was to reduce screen resolution to 1920x1080 and disable the "Force font DPI" option in KDE. Then C::B 20.03 works as expected without any side effects (so far).

I would still very much like to know if there is a way to control the font sizes used in the "Management" and "Logs & others" panels, in order to use C::B with a higher screen resolution.



Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Font size in "Manager" window, Projects/Resources tabs
« Reply #2 on: May 24, 2021, 05:52:54 pm »
Does changing "Settings -> Environment -> View -> Message log's font size" help?
Can you post the information in Help ->About -> Information?
(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 cacb

  • Lives here!
  • ****
  • Posts: 536
Re: Font size in "Manager" window, Projects/Resources tabs
« Reply #3 on: May 24, 2021, 06:17:01 pm »
Does changing "Settings -> Environment -> View -> Message log's font size" help?
Can you post the information in Help ->About -> Information?

Thanks, that does change the font size in the message log, so it is indeed helpful!  But it doesn't seem to do anything to the font size in the "Projects" tree, and that was the main issue I had. I guess the problem would be resolved if that setting also modified the "Projects" tree, or if there was a separate font size setting (e.g. "Management panel font size") next to it.

I have attached the About -> Information info.

It would be great if I could use the full screen resolution with Code::Blocks

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Font size in "Manager" window, Projects/Resources tabs
« Reply #4 on: May 25, 2021, 08:55:12 pm »
Can you:
1. Reset everything to defaults in KDE
2. Switch to the native resolution
3. Start CB
4. Start gtk3-widget-factory and switch to page 3 (you might need to install/compile this thing separately)
5. Post a screenshot of the two apps next to each other.

This might be another GTK3 issue, which needs to be resolved.
I don't see anywhere in our code (src/projectmanagerui.cpp/h) where we set the font for the tree.

p.s. There should a global way to change the fonts in gtk, but I don't know it. As always using GTK+non-gnome wm is a pain.
p.p.s. GTK3 is not really designed around fractional scaling factors. Setting 120 DPI is most probably leading to such scaling factors. What is the monitor you're using? What is its DPI?
(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 cacb

  • Lives here!
  • ****
  • Posts: 536
Re: Font size in "Manager" window, Projects/Resources tabs
« Reply #5 on: May 25, 2021, 09:55:03 pm »
Thanks for the follow-up....

I did 1-5, back to resolution 2560x1440, default Font DPI
to run  gtk3-widget-factory I did "sudo apt install gtk-3-examples"
Screenshot is attached, this is just a part of the screen.
The tree view fonts are painfully small.

Edit: the monitor is Philips PHL 275B1 (DP-0)
Resolution 107x107 dots per inch (according to NVIDIA X Server Settings)
GPU: GeForce GTX 1660 SUPER
« Last Edit: May 25, 2021, 10:00:25 pm by cacb »

Offline cacb

  • Lives here!
  • ****
  • Posts: 536
Re: Font size in "Manager" window, Projects/Resources tabs
« Reply #6 on: May 25, 2021, 11:04:37 pm »
Well, I found a different work around that seems to work in KDE

1. I kept the resolution at 2560x1440

2. In System Settings -> Fonts
Changed the "General" font from "Noto Sans 10pt" to "Noto Sans 14pt"   

I rebooted just to be sure (probably not required). Now the fonts in C::B "Manager" panel are larger and more agreeable.  It looks like 13pt is possible so fine adjustments may be possible.

The fonts in the Log windows are still small, but this is controlled within Code::Blocks Settings -> View -> "Message logs' font size".

This solution is a bit intrusive on other applications, but it seems initially as a usable work around.


Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Font size in "Manager" window, Projects/Resources tabs
« Reply #7 on: May 26, 2021, 09:42:26 am »
To me all fonts look fine (I'm on normal DPI monitor), and more importantly they are the same.
If KDE/Qt handles 107 DPI correctly you should find a way to change the fonts only for GTK-3.
It is probably done in the gtk config somewhere/somehow. https://developer.gnome.org/gtk3/stable/GtkSettings.html (there is the gtk-font-name).
I don't know how this works really.
(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 cacb

  • Lives here!
  • ****
  • Posts: 536
Re: Font size in "Manager" window, Projects/Resources tabs
« Reply #8 on: May 26, 2021, 01:07:38 pm »
They are the same, yes. But with default font size and high resolution they were much too small for my eyes.

I did search around and found that the gtk-3.0 font size is stored in ~/.config/gtk-3.0/settings.ini

At first I tried to edit the font size there, but it was overridden by KDE on login/reboot. Next attempt to set the font size was via KDE System settings -> Font, I changed the "General font size from 10 to 12. This had the effect of changing the gtk-3.0 font size in the settings.ini file:

[Settings]
gtk-application-prefer-dark-theme=0
gtk-button-images=1
gtk-cursor-theme-name=breeze_cursors
gtk-decoration-layout=icon:minimize,maximize,close
gtk-enable-animations=1
gtk-font-name=Noto Sans,  12
gtk-icon-theme-name=breeze
gtk-menu-images=1
gtk-primary-button-warps-slider=0
gtk-theme-name=Breeze
gtk-toolbar-style=GTK_TOOLBAR_BOTH_HORIZ


So it seems to me this is probably how to do it from KDE. The link you provided mentions gtk-font-name and its default  size = 10, which is too small for a high-resolution screen and my eyes.

So it looks like KDE System settings -> Font is the proper way.

I still see sometimes (not always) that the "Build Target" choice in the Compiler Toolbar is not showing properly (i.e. showing nothing) with increased font size, but it is not 100% repeatable so it is not something to worry about unless it persists. 

All of this would probably be easier if one could set the font size of the "Manager" panel within C::B, as is possible for the logs. But It seems to be workable the way it is now. I appreciate the assistance received!

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: Font size in "Manager" window, Projects/Resources tabs
« Reply #9 on: May 26, 2021, 01:49:51 pm »
You can add a ticket on SF for a feature request so it wont get lost...
I think it should be doable to implement it...

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Font size in "Manager" window, Projects/Resources tabs
« Reply #10 on: May 26, 2021, 01:53:08 pm »
I still see sometimes (not always) that the "Build Target" choice in the Compiler Toolbar is not showing properly (i.e. showing nothing) with increased font size, but it is not 100% repeatable so it is not something to worry about unless it persists. 
I think this is known problem.
I think you see this problem: https://sourceforge.net/p/codeblocks/tickets/956/

All of this would probably be easier if one could set the font size of the "Manager" panel within C::B, as is possible for the logs. But It seems to be workable the way it is now. I appreciate the assistance received!

Probably, but then other parts of the UI would be hard to read, also other gtk3 applications would suffer from the same problem, so I think it is better to solve this globally.


You can add a ticket on SF for a feature request so it wont get lost...
I think it should be doable to implement it...
@cacb Please don't do what BlueHazzard suggests, see above for explanation why I think this way. We don't need another option to confuse people.
(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 cacb

  • Lives here!
  • ****
  • Posts: 536
Re: Font size in "Manager" window, Projects/Resources tabs
« Reply #11 on: May 26, 2021, 03:28:58 pm »
I think this is known problem.
I think you see this problem: https://sourceforge.net/p/codeblocks/tickets/956/
This is most likely true, yes. I have build target names like 'GCC_Release' and 'GCC_Debug'. They are not very long IMHO, but they trigger the issue when increasing font size in some way. It is worth noting that disabling/enabling the compiler toolbar in a C::B session seems to fix the issue for that session, so it could also be an initialization problem.

All of this would probably be easier if one could set the font size of the "Manager" panel within C::B, as is possible for the logs. But It seems to be workable the way it is now. I appreciate the assistance received!

Probably, but then other parts of the UI would be hard to read, also other gtk3 applications would suffer from the same problem, so I think it is better to solve this globally.
Maybe consider a global font setting in C::B then, because the 'global dance' in the Window Manager (KDE or Gnome) in combination with applications is not so easy in practice. The global changes required for C::B affect other applications in sometimes unwanted ways, and the other way around. An example: I use the Brave browser and the URL bar had very small fonts indeed, and no way to adjust so I had to go back to setting KDE DPI to 120% again, which affects C::B and others. It would have been better to adjust that in Brave. Adjusting global settings is really a tight 'dance', sometimes with no good outcome. I appreciate the idea of adjusting globally, but sometime local overrides are necessary.

@cacb Please don't do what BlueHazzard suggests, see above for explanation why I think this way. We don't need another option to confuse people.
Ok, I have shared my thoughts above and leave it to you guys to decide. Thanks for the assistance in any case!

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Font size in "Manager" window, Projects/Resources tabs
« Reply #12 on: May 26, 2021, 05:30:45 pm »
I'm not sure what is correct actually.
Your monitor has dpi of 107, this means that 107/92=1.1630434782608696, so you have to run at 116.3% scaling factor to get the same fonts as the same 92 dpi monitor (full hd, 1920x1200, etc). But GTK3 doesn't support fractional scaling factors (at least the last time I've checked it didn't).
So to me it seems plausible that setting 120% is the correct thing to do. And it should be the only thing you need to do in order to get good looking apps.

Obviously this is not the case. Also it is quite hard to test thing, because it needs various different monitors. :(
I have to test what happens if I use VirtualBox's scaling factors.

Is there any documentation about this in KDE? Can you contact KDE people, so they can give a recommendation what is the correct value.
What do you need to do to get good looking KDE apps and fonts? Can you set it up and then show a screen shot next to gtk-widget-factory/CB?

:rant: As always the opensource people did the worst job compared to the commercial vendors (macOS/windows)
(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 cacb

  • Lives here!
  • ****
  • Posts: 536
Re: Font size in "Manager" window, Projects/Resources tabs
« Reply #13 on: May 27, 2021, 08:42:40 am »
Is there any documentation about this in KDE? Can you contact KDE people, so they can give a recommendation what is the correct value.
What do you need to do to get good looking KDE apps and fonts? Can you set it up and then show a screen shot next to gtk-widget-factory/CB?

:rant: As always the opensource people did the worst job compared to the commercial vendors (macOS/windows)

I am just a user of KDE. There is probably some documentation somewhere, but I have no idea where. For now, the experimentation and iterations described here have provided a reasonable compromise for myself, even if I may change it again. It is just that I think it was a bit more effort than it should be and my suggestions was aimed at making it easier for other users with similar issues.

Right now I am running with 12pt fonts and 120 DPI as a compromise between conflicting requirements from different applications. Now the tree view in gtk-widget-factory is different with bigger fonts and more spaces than in the C::B Projects tree.  I can live with this, it just illustrates that relying on only global settings does not always work 100% because not all applications adopt the settings the same way.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Font size in "Manager" window, Projects/Resources tabs
« Reply #14 on: May 27, 2021, 09:24:35 am »
I am just a user of KDE. There is probably some documentation somewhere, but I have no idea where. For now, the experimentation and iterations described here have provided a reasonable compromise for myself, even if I may change it again. It is just that I think it was a bit more effort than it should be and my suggestions was aimed at making it easier for other users with similar issues.
Does this mean that you're just mashing settings and hoping to get it right?
KDE has support forums and wikis. You as a user could describe the problem with more details, so they can guide you better.
If I am to start a discussion would be something like a third person description of the situation and I'm sure I'll get the details wrong.

Right now I am running with 12pt fonts and 120 DPI as a compromise between conflicting requirements from different applications. Now the tree view in gtk-widget-factory is different with bigger fonts and more spaces than in the C::B Projects tree. 
This difference is odd and as far as I know it shouldn't happen.
Can you show a screenshot with these two and some native KDE app. They probably look correct.

I can live with this, it just illustrates that relying on only global settings does not always work 100% because not all applications adopt the settings the same way.
Nope, this just illustrates what happens when the root causes for problem are not solved correctly.
I repeat even if we add a setting for the tree all other fonts would be too small and we'll have to add even more settings.
« Last Edit: May 27, 2021, 09:26:34 am by oBFusCATed »
(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!]