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++ » U++ Developers corner » Linux anti-aliasing fonts problem
Linux anti-aliasing fonts problem [message #31286] Fri, 18 February 2011 16:52 Go to next message
xzsa is currently offline  xzsa
Messages: 5
Registered: February 2011
Promising Member
Hi. I'm using Archlinux x86_64 and decided to try U++.
I've installed theide-svn and upp-svn from AUR.

I'm using Verdana as my default font with enabled anti-aliasing only for fonts smaller than 7.0pt and bigger than 12.0pt (for fonts between 7.0pt and 12.0pt anti-aliasing is disabled).
I am using KDE System Setings -> Fonts to configure this.

But "TheIDE" and the sample U++ applications I built with it look diferent from the other applications (GTK+ and KDE) - fonts of applications built with U++ are always anti-aliased and for all the other applications are not (with my current settings).

If I disable anti-aliasing completely (with no exclude range) then everything looks fine (all app fonts look the same), but captions in firefox look ugly. If I enable anti-aliasing completely all aps look the same, but I don't want to do this.

This problem presists in KDE-4, Openbox and LXDE.
In XFCE4 everithing looks OK. I don't know why.
Also if I install "gnome-control-center" package and use "gnome-settings-daemon" in Openbox fonts look OK. But I don't want to use gnome-settings-daemon since all the other apps look fine without it and it breaks my current Openbox configuration.

Is there any way to fix this issue?


Re: Linux anti-aliasing fonts problem [message #31289 is a reply to message #31286] Fri, 18 February 2011 20:53 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
xzsa wrote on Fri, 18 February 2011 10:52

Hi. I'm using Archlinux x86_64 and decided to try U++.
I've installed theide-svn and upp-svn from AUR.

I'm using Verdana as my default font with enabled anti-aliasing only for fonts smaller than 7.0pt and bigger than 12.0pt (for fonts between 7.0pt and 12.0pt anti-aliasing is disabled).
I am using KDE System Setings -> Fonts to configure this.

But "TheIDE" and the sample U++ applications I built with it look diferent from the other applications (GTK+ and KDE) - fonts of applications built with U++ are always anti-aliased and for all the other applications are not (with my current settings).

If I disable anti-aliasing completely (with no exclude range) then everything looks fine (all app fonts look the same), but captions in firefox look ugly. If I enable anti-aliasing completely all aps look the same, but I don't want to do this.

This problem presists in KDE-4, Openbox and LXDE.
In XFCE4 everithing looks OK. I don't know why.
Also if I install "gnome-control-center" package and use "gnome-settings-daemon" in Openbox fonts look OK. But I don't want to use gnome-settings-daemon since all the other apps look fine without it and it breaks my current Openbox configuration.

Is there any way to fix this issue?





We are attempting to read the antialiasing info from gtk. It works fine with current version of Ubuntu and gnome desktop.

Direct change would be trivial, the correct detection perhaps more complicated.

The detection code is in CtrlLib/ChGtk line 670, if you would like to try hacking this.

How gtk apps behave in your system?

Mirke
Re: Linux anti-aliasing fonts problem [message #31292 is a reply to message #31286] Sat, 19 February 2011 08:38 Go to previous messageGo to next message
xzsa is currently offline  xzsa
Messages: 5
Registered: February 2011
Promising Member
I have commented line 672 from CtrlLib/ChGtk.cpp
gtk_antialias = Nvl(GtkStyleInt("gtk-xft-antialias"), -1);

and now everything seems to work fine.
I don't understand how it works or why it works but it works.

The only difference I noticed is that the other applications start anti-aliasing when I set "Exclude range" to 10 pt or less, while the U++ apps start anti-aliasing when I set "Exclude range" to 9 pt or less. But it doesn't bother me.

index.php?t=getfile&id=3108&private=0

Re: Linux anti-aliasing fonts problem [message #31293 is a reply to message #31292] Sat, 19 February 2011 10:08 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
xzsa wrote on Sat, 19 February 2011 02:38

I have commented line 672 from CtrlLib/ChGtk.cpp
gtk_antialias = Nvl(GtkStyleInt("gtk-xft-antialias"), -1);

and now everything seems to work fine.
I don't understand how it works or why it works but it works.

The only difference I noticed is that the other applications start anti-aliasing when I set "Exclude range" to 10 pt or less, while the U++ apps start anti-aliasing when I set "Exclude range" to 9 pt or less. But it doesn't bother me.

index.php?t=getfile&id=3108&private=0




Well, that is nice to know, but that does not really solve the problem... because we definitely want to know gtk setting there.

My guess is that in your system, the setting of antialiasing (the dialog you posted) works on lower level than the setting in gtk and usually applications are not gtk (or gtk is able to to detect something else too). This theory is supported by the fact that in xfce, everything is OK (xfce is gtk based).

Can I repeat my question how gtk apps behave for you (I mean, in KDE)?

Other than, possible semisolution would be to not load the info from gtk when desktop is not gtk based (but I wonder how to detect that).

I am moving this to development corner, as this is something to resolve ASAP Smile

Mirek
Re: Linux anti-aliasing fonts problem [message #31296 is a reply to message #31286] Sat, 19 February 2011 13:51 Go to previous messageGo to next message
xzsa is currently offline  xzsa
Messages: 5
Registered: February 2011
Promising Member
All applications - GTK+ and KDE(Qt4) look the same - fonts smaller than 12pt are not antialiased and fonts bigger tahn 12pt are antialiased, only for U++ applications all font sizes are antialiased (with my current settings). And this is under KDE, LXDE and Openbox.

When using Gnome or XFCE4 U++ applications look like the oter applications it seems that there is something running (like gnome-settings-daemon) which fixses it.

I changed line 672 of CtrlLib/ChGtk.cpp

from
gtk_antialias = Nvl(GtkStyleInt("gtk-xft-antialias"), -1);

to
gtk_antialias = -1;

and now U++ applications look like the other applications under all desctop enviroments I've tryed.
It looks that when gtk_antialias = -1; gtk uses the default settings of X server.

I also uncomented row 674 and comented row 675:
674	gtk_hintstyle = GtkStyleString("gtk-xft-hintstyle");
675//	gtk_hintstyle = gtk_hinting? "hintfull" : "hintnone"; // Gtk does not seem to follow its own rules...


and it works fine - before there where or full hinting or no hinting, now slight and medium hinting also work.
Re: Linux anti-aliasing fonts problem [message #31307 is a reply to message #31296] Sun, 20 February 2011 14:46 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
xzsa wrote on Sat, 19 February 2011 07:51

All applications - GTK+ and KDE(Qt4) look the same - fonts smaller than 12pt are not antialiased and fonts bigger tahn 12pt are antialiased, only for U++ applications all font sizes are antialiased (with my current settings). And this is under KDE, LXDE and Openbox.

When using Gnome or XFCE4 U++ applications look like the oter applications it seems that there is something running (like gnome-settings-daemon) which fixses it.

I changed line 672 of CtrlLib/ChGtk.cpp

from
gtk_antialias = Nvl(GtkStyleInt("gtk-xft-antialias"), -1);

to
gtk_antialias = -1;

and now U++ applications look like the other applications under all desctop enviroments I've tryed.
It looks that when gtk_antialias = -1; gtk uses the default settings of X server.



...which is sort of problem, because you can change the setting in Gnome to affect that.

Thus I believe that probably the right solution is indeed to detect whether Gnome desktop is active or not and put there -1 only if it is not...

Mirek
Re: Linux anti-aliasing fonts problem [message #31308 is a reply to message #31307] Sun, 20 February 2011 14:54 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
OK, please try to insert

if(GetDesktopManager() != "gnome")
gtk_antialias = -1;

at line 673 of CtrlLib/ChGtk.cpp, or just try latest svn.

If you can, please try and report all desktop environments available to you Smile

Mirek
Re: Linux anti-aliasing fonts problem [message #31315 is a reply to message #31286] Sun, 20 February 2011 23:08 Go to previous message
xzsa is currently offline  xzsa
Messages: 5
Registered: February 2011
Promising Member
Thanks it works fine in all desktop environments I have tested: KDE, gnome, XFCE-4, LXDE, Openbox.
Previous Topic: Ide MT
Next Topic: Animated GIF support, anybody?
Goto Forum:
  


Current Time: Fri Mar 29 05:48:15 CET 2024

Total time taken to generate the page: 0.00874 seconds