Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Developing U++ » Bugs (& fixes) » Apps have high font zoom under Linux [FIXED]
Apps have high font zoom under Linux [FIXED] [message #16596] Mon, 30 June 2008 21:51 Go to next message
cbpporter is currently offline  cbpporter
Messages: 1400
Registered: September 2007
Ultimate Contributor
I never used U++ under Linux for anything more than seeing that it works and being happy that it's crossplatform. My main development area still targets Windows, but now I'm preparing and testing binaries for Linux distribution also.

and here I found a strange little problem. I downloaded the latest SVN deb package, installed it under openSUSE 11 (which is a rpm based distro), and everything works fine, except that all applications compiled by me look as if there is a font zooming active. Both font size and layouts are scaled and are quite large. TheIDE from the deb does not have this problem (nor does any other Gtk app), but if I compile my own TheIDE, it also gets the large fonts. Any idea how to fix this? I'll try an older stable deb tomorrow, to see if it still behaves this way.

[Updated on: Fri, 04 July 2008 15:46] by Moderator

Report message to a moderator

Re: Apps have high font zoom under Linux [message #16604 is a reply to message #16596] Tue, 01 July 2008 11:09 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 12962
Registered: November 2005
Ultimate Member
Hm, what ide are you using?

Is this GTK or KDE?

Well, we are reading zooming factor from GTK, the code is in

CtrlLib/ChGtk.cpp 615

and is used in

CtrlCore/Ctrl.cpp 735

I believe that putting some nice LOGs there should reveal the problem.

Mirek
Re: Apps have high font zoom under Linux [message #16605 is a reply to message #16604] Tue, 01 July 2008 16:58 Go to previous messageGo to next message
cbpporter is currently offline  cbpporter
Messages: 1400
Registered: September 2007
Ultimate Contributor
luzr wrote on Tue, 01 July 2008 12:09

Hm, what ide are you using?

Is this GTK or KDE?

Well, we are reading zooming factor from GTK, the code is in

CtrlLib/ChGtk.cpp 615

and is used in

CtrlCore/Ctrl.cpp 735

I believe that putting some nice LOGs there should reveal the problem.

Mirek

I'm using KDE (3.x series and 4.0.4). I did the same test under Gnome (after I installed it) and IceWm, and both of them are issue free. I think it is related to the different Gtk theme imposed by KDE. It is strange how only applications compiled by me have the issue. Thanks for the locations. I'll try to see if some loging can help to identify the problem.


Another problem under KDE is that the system tray icon is not transparent. You can see this in the SystemTray reference package.
Re: Apps have high font zoom under Linux [message #16606 is a reply to message #16605] Tue, 01 July 2008 20:57 Go to previous messageGo to next message
captainc is currently offline  captainc
Messages: 278
Registered: December 2006
Location: New Jersey, USA
Experienced Member
I am also experiencing this problem on Ubuntu 7.10 (Gnome).

Screenshot of hello world app attached.
Re: Apps have high font zoom under Linux [message #16614 is a reply to message #16606] Wed, 02 July 2008 13:47 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 12962
Registered: November 2005
Ultimate Member
captainc wrote on Tue, 01 July 2008 14:57

I am also experiencing this problem on Ubuntu 7.10 (Gnome).

Screenshot of hello world app attached.


Is not it possible you have differnt DPI settings in X11?

Mirek
Re: Apps have high font zoom under Linux [message #16615 is a reply to message #16614] Wed, 02 July 2008 14:29 Go to previous messageGo to next message
cbpporter is currently offline  cbpporter
Messages: 1400
Registered: September 2007
Ultimate Contributor
Ok, so the problem is in ChGtk line 616.

int xdpi = Nvl(GtkStyleInt("gtk-xft-dpi"), 72 * 1024);

GtkStyleInt is returning 98280, which is about 33% percent larger than the default, which has the right proportions. I need to track down why it is larger, but it is somewhat harder because I never worked with Gtk theme engine and have no idea where to find setting and stuff.

The style name is Gilouche 2.0.
Re: Apps have high font zoom under Linux [message #16631 is a reply to message #16615] Thu, 03 July 2008 17:33 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 12962
Registered: November 2005
Ultimate Member
cbpporter wrote on Wed, 02 July 2008 08:29

Ok, so the problem is in ChGtk line 616.

int xdpi = Nvl(GtkStyleInt("gtk-xft-dpi"), 72 * 1024);

GtkStyleInt is returning 98280, which is about 33% percent larger than the default, which has the right proportions. I need to track down why it is larger, but it is somewhat harder because I never worked with Gtk theme engine and have no idea where to find setting and stuff.

The style name is Gilouche 2.0.


Well, what does say

xdpyinfo|grep resolution


?

Mirek
Re: Apps have high font zoom under Linux [message #16632 is a reply to message #16631] Thu, 03 July 2008 18:38 Go to previous messageGo to next message
captainc is currently offline  captainc
Messages: 278
Registered: December 2006
Location: New Jersey, USA
Experienced Member
Mine:
resolution: 99x98 dots per inch
Re: Apps have high font zoom under Linux [message #16633 is a reply to message #16632] Thu, 03 July 2008 19:50 Go to previous messageGo to next message
Mindtraveller is currently offline  Mindtraveller
Messages: 916
Registered: August 2007
Location: Russia, Moscow rgn.
Experienced Contributor

same problem with big system fonts in TheIDE.
Platform: KDE 3.5.8, FreeBSD 6.3
U++ version: latest SVN, TheIDE itself is fresh-recompiled

xpdyinfo says:
Quote:

resolution: 86x86 dots per inch


Posting sample screenshot with TheIDE and some other system application in foreground. Nothe the difference between font sizes:
index.php?t=getfile&id=1248&private=0
  • Attachment: upp-match.jpg
    (Size: 117.12KB, Downloaded 679 times)

[Updated on: Thu, 03 July 2008 19:58]

Report message to a moderator

Re: Apps have high font zoom under Linux [message #16634 is a reply to message #16631] Fri, 04 July 2008 09:42 Go to previous messageGo to next message
cbpporter is currently offline  cbpporter
Messages: 1400
Registered: September 2007
Ultimate Contributor
luzr wrote on Thu, 03 July 2008 18:33


Well, what does say

xdpyinfo|grep resolution



It says 95x96 under both KDE and Gnome.
Re: Apps have high font zoom under Linux [message #16635 is a reply to message #16615] Fri, 04 July 2008 13:26 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 12962
Registered: November 2005
Ultimate Member
cbpporter wrote on Wed, 02 July 2008 08:29

Ok, so the problem is in ChGtk line 616.

int xdpi = Nvl(GtkStyleInt("gtk-xft-dpi"), 72 * 1024);

GtkStyleInt is returning 98280, which is about 33% percent larger than the default, which has the right proportions. I need to track down why it is larger, but it is somewhat harder because I never worked with Gtk theme engine and have no idea where to find setting and stuff.

The style name is Gilouche 2.0.


I have tried Gilouche, not problem spotted.... Sad

In the same time:

GtkStyleInt("gtk-xft-dpi") = 98304

but everything is still OK....

Mirek
Re: Apps have high font zoom under Linux [message #16639 is a reply to message #16635] Fri, 04 July 2008 14:12 Go to previous messageGo to next message
cbpporter is currently offline  cbpporter
Messages: 1400
Registered: September 2007
Ultimate Contributor
luzr wrote on Fri, 04 July 2008 14:26


I have tried Gilouche, not problem spotted.... Sad

In the same time:

GtkStyleInt("gtk-xft-dpi") = 98304

but everything is still OK....

Mirek

Strange. I guess it depends on the installed packages/configuration. I'll try on a fifferent computer with a different monitor/resolution, to see if it still behaves this way. I really don't know how to take this on or what other tests to run. Do you have any other ideas?

Not even Ctrl::NoLayoutZoom() seems to fully fix this. Some layout are Ok, others are still large, and fonts are still huge.
Re: Apps have high font zoom under Linux [message #16640 is a reply to message #16639] Fri, 04 July 2008 14:19 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 12962
Registered: November 2005
Ultimate Member
cbpporter wrote on Fri, 04 July 2008 08:12


Not even Ctrl::NoLayoutZoom() seems to fully fix this. Some layout are Ok, others are still large, and fonts are still huge.


Now this is possible clue.

Some layout withing single app? Or different apps?

BTW, have you tried debug/release?

What is LOG of "font_name" in ChGtk?

This is really pity - I think this should be fixed before the release. If I only could reproduce the problem...

Mirek
Re: Apps have high font zoom under Linux [message #16641 is a reply to message #16640] Fri, 04 July 2008 14:35 Go to previous messageGo to next message
cbpporter is currently offline  cbpporter
Messages: 1400
Registered: September 2007
Ultimate Contributor
luzr wrote on Fri, 04 July 2008 15:19


Now this is possible clue.

Some layout withing single app? Or different apps?


I tried UWord, and all the layouts seem to be scaled correctlly when NoLayoutZoom is use, but other interface elements like Menus, Toolbars and the controls embedded inside are still large.

Quote:


BTW, have you tried debug/release?


I didn't manage to create a release binary before, because it couldn't find a lib in release mode. But I remembered the forum topic about enabling shared builds, and now it works. This should be default by the way IMO.

And yes, release builds have no problems. I guess this solves the mystery why only applications compiled by me had zooming issues. Could others who reported this problem check to see if using release mode fixes the problem?

Quote:


What is LOG of "font_name" in ChGtk?


font_name is "FreeFreeFreeFree" with a lot more "Free"s in debug mode. I assume that this is not normal. In release it is "NET SUPPORTED".
Re: Apps have high font zoom under Linux [message #16642 is a reply to message #16641] Fri, 04 July 2008 14:47 Go to previous messageGo to next message
cbpporter is currently offline  cbpporter
Messages: 1400
Registered: September 2007
Ultimate Contributor
cbpporter wrote on Fri, 04 July 2008 15:35


font_name is "FreeFreeFreeFree" with a lot more "Free"s in debug mode.


Yes, this is the problem!
const char* font_name = GtkStyleString("gtk-font-name");

But GtkStyleString returns String. Won't the temporary be destroyed?

Changing to:
String font_name = GtkStyleString("gtk-font-name");
fixes the bug.
Re: Apps have high font zoom under Linux [message #16645 is a reply to message #16642] Fri, 04 July 2008 15:43 Go to previous message
mirek is currently offline  mirek
Messages: 12962
Registered: November 2005
Ultimate Member
cbpporter wrote on Fri, 04 July 2008 08:47

cbpporter wrote on Fri, 04 July 2008 15:35


font_name is "FreeFreeFreeFree" with a lot more "Free"s in debug mode.


Yes, this is the problem!
const char* font_name = GtkStyleString("gtk-font-name");

But GtkStyleString returns String. Won't the temporary be destroyed?

Changing to:
String font_name = GtkStyleString("gtk-font-name");
fixes the bug.


OMG, I am really stupid sometimes... Sad

BTW, maybe a reason why it worked in release Smile

Mirek
Next Topic: ArrayCtrl: Column::Edit and control disappears
Goto Forum:
  


Current Time: Thu Dec 03 13:52:21 CET 2020

Total time taken to generate the page: 0.01420 seconds