Tutorials On Using Anti-Aliased Fonts With KDE

LinuxPlanet recently published an article which contains a tutorial on how to set up anti-aliased fonts on your KDE 2 box. This article complements the tutorial posted some time ago by Lars Knoll.

Dot Categories: 

Comments

by Justin (not verified)

Hey what is this 2.1-update I see in the "stable" directory at ftp.kde.org ? There are only a few files in there, and they are listed as pre-2.1.1. Are these some late fixes? Did I miss an announcement? :)

-Justin

by Evandro (not verified)

you didn't miss anything ;)

as you probably know, 2.1.1 will be 2.1 + critical bug fixes, new icons and improved i18n and documentation. so those are the critical bug fixes, new icons and improved doc they have so far. you can get the i18n-updates from cvs.

by Arnd Bergmann (not verified)

... and I spent almost a week dissecting kdelibs, qt and libXft!
Why me?

by Eric Laffoon (not verified)

I peel your fain... er... feel you pain. ;-)

I didn't quite go that far but I failed to comprehend that xfs and xft load seperate font collections. Seems a bit weird and less than efficeint. Then again it's interesting to have font servers running like that. I found XftConfig a long way from my other config file.

However my system NEVER looked so good so it was worth it!!!

BTW anyone get Corel Draw's font server working with this menagerie?

by Arnd Bergmann (not verified)

Damn, it was not the FontPath. I just thought that if the article is so specific about it, there has to be some meaning behind it.

Anyway, I still can't select non-antialiased fonts in KDE. The most obvious symptoms of this are that in Konsole, you can only choose a font called 'fixed', which can be replaced by anything in XftConfig or is automatically replaced by the alphabetically (!) first font otherwise.
The same happens to the font settings in Control Center when you try to get back to defaults or have a fresh installation.

I have fixes for both symptoms in kdelibs, but the real problem is somewhere deeper.

Does anyone actually have non-AA fonts in kde2.1/Qt2.3/XFree86-4.0.2-branch or does is work in another version?

by Ravi (not verified)

The problem is with Xft. Xft has a bug related to choosing fixed width fonts. Please look at http://lists.kde.org/?l=kde-devel&m=98399428807752&w=2
which contains a fix for your problem.

Ravi

by John Donagher (not verified)

If you're on Debian/Unstable, all you should need to do is put set the environment variable QT_XFT=true. The newest KDE and QT have built-in support for anti-aliasing.

I'm using Debian, but I'm using only the testing branch, and apparently I have the wrong XFree packages (even though they are 4.0.2 not 3.3.X). Trying to start an xterm with anti-aliased text gives the error "missing extension RENDER on Display 0.0" or some such.

The KDE and QT packages are correct (QT_XFT is set to 1, not that it helps without the render extension).

Is there any way to get XFree packages with the Render extension enabled without going over to unstable entirely? (I tried compiling XFree from source once but it failed. I have the worst luck compiling software! I can never get KDE to compile either!)

What video card are you using? maybe that's caused if your video driver doesn't support the render extension (for example, the old nvidia closed-source drivers).

I'm using a S3 Savage4, and I had heard that the Savage driver didn't yet support the render extension, so I tried the VESA driver(which does). It didn't work either :-(

The latest driver for the savage does have the render extention in it .. go to tim's page and pick it up

http://www.probo.com/timr/savage40.html

by Matthew Vinton (not verified)

I FINALLY got Anti-Aliased TT fonts to work under KDE - VERY nice!

I have only one question - the "fixed" font keeps getting set back to "adabi" (which was at first the default everything was set to) - this font seems to be used in quite a lot of web-pages, and I would like to choose something more appropriate. Any suggestions?

This is a bug in XFree86, I believe. You'll either have to update to XFree86 CVS or apply a workaround patch to Qt, which I don't have handy but I think Lars posted one on the kde-devel list.

XFree86 4.0.3 is very close to release. Hang in there for a few days.

are you sure?
4.0.2 was said to be "very close" during months.

Where did you get this information from, I'd like to know more about 4.0.3 (esp. if there will be a working G400 with 3D hardware accel., using what Gareth Hughes did the past weeks for DRI project).

look here:
http://www.xfree86.org/cvs/changes_4_0_2.html

as you see, Xfree 4.0.3 is really close

You can get Xfree86 4.0.3 now from their ftp site (or better yet, one of their mirors). It is available as a patch to 4.0.2, but I have yet to find the complete source tarball for it.

by Geir Kielland (not verified)

This is a quick fix. It will not solve the problem, but you will have a fonttype that is readable. In your ~.kde directory, go to share/config/ and open the file kdeglobals in kwrite or something. Edit the fontspart of it, have a look and you'll know what I mean.... You should then change the fonttype "default" to courier, or some other available font of your choice. Don't go back to "look and feel/fonts" in Kcontrol. It will reset your manually chosen font. Then you have to edit kdeglobals once more.... Cheers!Geir K

Hm, not luck here. I compiled Freetype first, then downloaded XFree from cvs, edited host.conf file, compiled XFree (without any errors), then compiled qt-2.3beta1 (I suppose that is also good one) with -xft option, then compiled whole kde 2.1 from tarballs, then added path to my ttf directory in XftConfig file, then deleted fonts directory in /.kde/share and deleted kdefonts file in /.kde/share/config dir, etc.etc. but nothing happens. I don't have antialiased fonts. When I run
xdpyinfo in konsole I don't have RENDER extension there and I get this: XFree86 version: 4.0.99.1. Is it the right version? I downloaded it from XFree cvs (cvs co xc).
I read all tutorials (I also did: export QT_XFT=true in .xinitrc file in my home dir), but nothing helps. I have Matrox Millenium 450 graphic card. Is it card that is problem?

[david@dolphin david]$ xdpyinfo
name of display: :0.0
version number: 11.0
vendor string: The XFree86 Project, Inc
vendor release number: 4002

Hi,
I got XFree-4.0.2 binary from Rawhide, alongwith freetype2 , qt2.3.0 which is compiled with xft support. When I try running KDE (or any QT app) after setting QT_XFT=true, I get " Xlib: extension "RENDER" missing on display ":0.0" " , which is true, since I dont' see RENDER from output of xdpyinfo.
Question is how to enable RENDER ? I have a Intel 810e chipset.
Can anyone help me to see clearly :) ?

Parag

I also have the same issue. I am using Debian\testing with i810 card..

The RENDER extension needs the module 'extmod' to be loaded in XF86Config, and FreeType also needs the 'freetype' module. Btw, QT_XFT should normally be set to 0 or 1.
My X display info:

name of display: :0.0
version number: 11.0
vendor string: The XFree86 Project, Inc
vendor release number: 40099001
XFree86 version: 4.0.99.1
...
number of extensions: 30
BIG-REQUESTS
...
RECORD
RENDER
SECURITY

Trisk, can you please explain how to load "extmod" module? When I add the line Load "extmod" in XF86Config-4 then I can't start X, I get error that it is incorrect. And how do you set QT_XFT to 0 or 1 ?
Thanks.

Yeeeeees, I've solved the problem. Matrox has released the new driver for Matrox Millenium G200, G400 and G450 for XFree 4.0.2. I just installed the new driver and
antialiased fonts are here. Bravo Matrox :::)))

Hey this last step was a bit to fast - i still have the antialiasing problem in my setup - and i havnt found a solloution yet.

ive using a Mandrake 8.0 - KDE with a TNT card.
first of all, my KDE is running fine at this time, but im having a problem compiling a program using Qt (3.0.1) - and it seems to me that im getting the same problem here as you are referring to.

ive downloaded the sources from Trolltechs home page and tried compiling it both with and without support for antialiasing (both occasions it took almost 8 hours to complete, and im not willing to do it all to often.) and i got the same result in both situations)

where am i? what shall i do? - download the XFree kit and recompile it as well?

Before i do, i hope i can get a good advice from someone who have had that problem.

-Tobibobi-

by nonono (not verified)

prior to anything is wich driver it works with
i tried a few months ago and recompiled xfree many times in search of my mistake when it was the drivers which were unable to render AA.
no, it's not funny....

For anyone using SuSE 7.1 there is a nice guide here:

www.nadmm.com/show.php?story=articles/aafonts-HOWTO.inc

(Probably useful for people running other distros as well.)

Yesss!!!!

Thanks man. This tiny tutorial got me up 'n running in under five minutes!

Thanks again.

I just wanted to say, that if you are running either on a laptop, or are using a _digital_ LCD screen, then you really should turn sub-pixel rendering on. Add this to your /etc/X11/Xresources (or wherever your dist put it, I'm using Mandrake 8.0beta) and add this somewhere:

Xft:rgba

Anyway, that's it. It makes as big a difference, I think, compared to regular anti-aliasing, as comparing no aa with normal aa.

Erik

I just wanted to say, that if you are running either on a laptop, or are using a _digital_ LCD screen, then you really should turn sub-pixel rendering on. Add this to your /etc/X11/Xresources (or wherever your dist put it, I'm using Mandrake 8.0beta) and add this somewhere:

Xft:rgba

Anyway, that's it. It makes as big a difference, I think, compared to regular anti-aliasing, as comparing no aa with normal aa.

Erik

by Karl Garison (not verified)

I'm running Redhat 6.2 with XFree86 4.02 and an RPM of Qt 2.3.0 built with Xft. xdpyinfo lists RENDER extention.

I have the following line in my .Xclients file:

QT_XFT=true

After I start X and display my enviroment variables, I see that this has been changed to:

QT_XFT=0

What gives? I also checked Preferences -> Look & Feel -> Style, and I did not have an option there to enable anti-aliased fonts.

Ideas????

-Karl

by Matthew Vinton (not verified)

This bugged me for awhile. First you will want to be sure anti-aliased fonts are working at ALL... while in KDE, open up a console and type QT_XFT=TRUE, then open "designer", which will run as a pure QT app, and if you get TT fonts, you will be golden.

KDE doesn't work because kicker (I beleive) sets QT_XFT=0 everytime one starts KDE. What you need to do is edit .kde/share/config/kcmdisplayrc, and add the following lines (both lines...)

[KDE]
AntiAliasing=true

This will perform the same action as using the non-existant check mark.

Good luck!

by Karl Garrison (not verified)

Thanks for your help. I assume that it will be obvious if the fonts are drawn anti-aliased then?

-Karl

by ady (not verified)

I put the lines in .kde/share/config/kcmdisplayrc and it works! Nice. Thanks.

by Matthew Vinton (not verified)

I thought I would slap up my experiences doing this with/ RH 7.0 and binary packages...

see
http://www.vinton-sys.org/kde-antialiasing.htm

and tell me what you think...

by man (not verified)

after compiling and installing xfree86 4.0.2 I got only static library libXft.a
how to get shared one? what's wrong?

Well, I finally got it working after recompiling X from source with FreeType2 support enabled. It's wonderful, but Xft is only serving PostScript fonts. xfontsel can see the TrueType fonts, but nothing else can - Gimp, KDE, nothing. Any ideas anyone? I have TrueType working properly using the normal FontPath method and the freetype module, and I did remember to comment out the FontPath line in XF86Config and I did remember to add the dir line in XftConfig. Is there anything special I need to do to the directory beyond the normal ttmkfdir / mkfontdir?

by Thomas Stromberg (not verified)

Welp, I deinstalled X and everything depending on it today for a fresh start. So I installed: XFree86 4.0.3, Qt 2.3.0 + xft, and KDE 2.1

And a great mystery happened: If I start a normal QT2 app, like qhacc, or avifile/aviplay, it works great. If I try a kde app, watch:

helix@subedei (~)% export QT_XFT=false
helix@subedei (~)% kcalc
(works great!)
helix@subedei (~)% export QT_XFT=true
helix@subedei (~)% kcalc
KCrash: crashing.... crashRecursionCounter = 2
KCrash: Application Name = kcalc path =

If this happens to you, or KDE starts blank, do a ktrace on the process -- you will see which TTF file it's trying to read and crashing on. I guess KDE tries to load every font?

Unfortunatly, I had 357 truetype fonts, and I don't yet want to go through them one by one to see what's crashing. The microsoft fonts work great however.. ugh. That was a sick statement to make

Thank You!

I had everything working fine, then it suddenly broke for this very reason. After this post I'm exiting mozilla and restarting konqueror.

Thanks again!

After all, I got aa working. But: How can I use bitmap-fonts when aa is enabled? I read all the tutorials, but didn't find a hint.

by Michael Driscoll (not verified)

As far as I understand it, you just need to edit your XftConfig and add FontPath's for all of your other (Type1, bitmapped, etc) font directories.

by Arnd Bergmann (not verified)

No, that does not work. It looks to me like Qt currently does not use the bitmapped fonts through libXft, i.e. it does never set XFT_CORE for any Xft funtion.
On the other hand, applications that do set this flag should work even when they are not in the directories defined in XftConfig (they are only for Type1 and TrueType) but come from the font server.
If anybody definiately is using both xft and core fonts in KDE, could you please mail me your configuration?

by Oliver Heins (not verified)

> If anybody definiately is using both xft and core fonts in KDE, could you please mail me your configuration?

AOL ME (or even better: post it here)

olli

by Mario Giammarco (not verified)

Please help me! I am the last person on earth that does not have antialiasing working!

I have aa in my xterm
I use debian/testing with lastest kde from kde.tdyc.com.
In the docs I read that all packages have AA compiled in.
No old kcmfont etc. All made from scratch
QT_XFT=1 etc.
The only thing missing is a libXft.so. I have only the static libXft.a.
I have a lot of truetype fonts and 3 font servers xfs xfstt xfs-xtt
XftConfig by Keithp

What am I doing wrong?

by Leonel Martins (not verified)

Same problem here... xterm works, kde has the AA checkbox enabled, QT_XFT is correctly set but no AA in KDE!!
Anybody knows what's happening?

by Dave (not verified)

I've set everything up nicely now - lovely anti-aliased TT fonts abound, apart from one exception - Konsole. It comes out l i k e t h i s. What's the problem?

by clickfurtle (not verified)

I have just solved the same problem for my setup - SuSE 7.1, KDE 2.1.1.

I'd used the SUSE script fetchmsttfonts to get my first truetype fonts - it downloaded 4 .exes from the MS site, but could only extract the fonts from 1 - giving my fonts like comic, georgia, trebuchet. I also got the k o n s o l e spacing problem, and it reminded me of seeing the same symptoms when trying to used a proportional font in KDE 1 konsole.

I appropriated the truetype fonts from my Windows installation, restarted KDE and the spacing problem went away .

Maybe expanding your font selection will help you too.

by Graham TerMarsch (not verified)

Ok, maybe I'm just missing something here.....

I've downloaded all of the Mandrake 7.2 packages that are listed in the 2.1.1 distributions directory on ftp.kde.org. This includes XFree 4.0.3, qt-2.3.0, and all of kde 2.1.1. I've installed all of these RPMs and thats fine.

But, no matter what I try here, I'll be darned if I can get AA fonts to work properly.

I'm using the latest 0.9.7 NVidia driver, which does support the RENDER extension.

I've tried updating my XF86Config to match the one in the tutorial, updated my XftConfig file accordingly, got the fonts from Keith's site, but still can't get this sucker to work.

Anyone out there either using Mandrake or an NVidia card that's managed to get this to work??

Exactly the same with my mandrake. Up to date drivers from Nvidia, the mandrake binaries etc.

Everything seems to be right, but I suspect the XftConfig file is not really read in.

Is there a way to get a verbose output from Xft or something like that?