View previous topic :: View next topic |
Author |
Message |
bazik Retired Dev
Joined: 22 Jul 2002 Posts: 277 Location: Behind you.
|
Posted: Thu Nov 21, 2002 5:38 pm Post subject: How to enable AA in Fluxbox,GKrellM,Abiword,Phoenix etc... |
|
|
Hi!
First we need to install some packages (you should already have XFree installed... I have XFree 4.2.1 running here)
(To emerge masked packages use "emerge /usr/portage/pathtoebuild.ebuild" or unmask it)
Code: |
emerge freetype # my version: 2.1.2-r1
emerge xft # my version: 2.0-r1
|
Edit: "emerge freefonts sharefonts" for some more truetype fonts
Now edit your /etc/fonts/fonts.conf and add the paths of the truetype fonts. Here is mine (only the part I modified):
Code: |
<!-- Font directory list configured on Mon Oct 21 20:09:40 UTC 2002 -->
<dir>/usr/X11R6/lib/X11/fonts</dir>
<dir>/usr/share/fonts</dir>
<dir>~/.fonts</dir>
|
You can also play with the "enable sub-pixel rendering". It might improve the font quality. To enable it, just remove the comment:
Code: |
<!--
Enable sub-pixel rendering
-->
<match target="font">
<edit name="rgba" mode="assign"><const>rgb</const></edit>
</match>
|
(on my laptop, the fonts look better with sub-pixel rendering)
Edit: According to Lovechild, sub-pixel rendering only works on landscape formed LCD display. Thanks for the info!
Next, edit your /etc/X11/XF86Config and make sure you have all FontPaths to your truetype fonts there:
Code: |
FontPath "/usr/X11R6/lib/X11/fonts/local/"
FontPath "/usr/X11R6/lib/X11/fonts/misc/"
FontPath "/usr/X11R6/lib/X11/fonts/75dpi/:unscaled"
FontPath "/usr/X11R6/lib/X11/fonts/100dpi/:unscaled"
FontPath "/usr/X11R6/lib/X11/fonts/Type1/"
FontPath "/usr/X11R6/lib/X11/fonts/truetype"
FontPath "/usr/X11R6/lib/X11/fonts/Speedo/"
FontPath "/usr/X11R6/lib/X11/fonts/75dpi/"
FontPath "/usr/X11R6/lib/X11/fonts/100dpi/"
FontPath "/usr/X11R6/lib/X11/fonts/artwiz/" # optional, fluxbox artwiz package :)
|
Restart X now.
Lets first enable AA in Phoenix. To do so, install Phoenix and edit your /path/to/phoenix/phoenix/defaults/pref/unix.js file.
Search for the TrueType section and modify it like this:
Code: |
// TrueType
pref("font.FreeType2.enable", true);
pref("font.freetype2.shared-library", "libfreetype.so.6");
// if libfreetype was built without hinting compiled in
// it is best to leave hinting off
pref("font.FreeType2.autohinted", false);
pref("font.FreeType2.unhinted", false);
// below a certian pixel size anti-aliased fonts produce poor results
pref("font.antialias.min",0);
pref("font.embedded_bitmaps.max", 1000000);
pref("font.scale.tt_bitmap.dark_text.min", 0);
pref("font.scale.tt_bitmap.dark_text.gain", "0.0");
// sample prefs for TrueType font dirs
pref("font.directory.truetype.1", "/usr/share/fonts/truetype");
pref("font.directory.truetype.2", "/usr/X11R6/lib/X11/fonts/TTF");
pref("font.directory.truetype.3", "/usr/X11R6/lib/X11/fonts/truetype");
|
Save it and start Phoenix... the fonts should have changed now
If they looks bad, try to set them to the following settings... it looks awesome with these fonts settings here:
Code: |
# Tools -> Preferences -> Fonts and Colors
Proportional: Serif (Size: 16)
Serif: monotype-arial-iso8859-15
Sans-Serif: monotype-arial-iso8859-15
Monospace: monotype-courier new-iso8859-15 (Size: 12)
Minimum font size: 9
|
Phoenix should look sweet now
Next is Fluxbox. Emerge Fluxbox (at least 0.1.13). If you get an error during compile about some "parse errors" in "Xft.h", replace your /usr/X11R6/include/X11/Xft/Xft.h with this one.
When the compile is done, Fluxbox should be linked against Xft2.0... check it with "ldd":
Code: |
bazik@genesis bazik $ ldd /usr/bin/fluxbox
libSM.so.6 => /usr/X11R6/lib/libSM.so.6 (0x40027000)
libICE.so.6 => /usr/X11R6/lib/libICE.so.6 (0x40030000)
libX11.so.6 => /usr/X11R6/lib/libX11.so.6 (0x40047000)
libXext.so.6 => /usr/X11R6/lib/libXext.so.6 (0x40113000)
libXft.so.2 => /usr/lib/libXft.so.2 (0x40123000) # <<<<<<<<<<<
libstdc++.so.5 => /usr/lib/gcc-lib/i686-pc-linux-gnu/3.2/libstdc++.so.5 (0x40139000)
libm.so.6 => /lib/libm.so.6 (0x40203000)
libgcc_s.so.1 => /usr/lib/gcc-lib/i686-pc-linux-gnu/3.2/libgcc_s.so.1 (0x40226000)
libc.so.6 => /lib/libc.so.6 (0x4022e000)
libgtk-1.2.so.0 => /usr/lib/libgtk-1.2.so.0 (0x40352000)
libgdk-1.2.so.0 => /usr/lib/libgdk-1.2.so.0 (0x404cb000)
libgmodule-1.2.so.0 => /usr/lib/libgmodule-1.2.so.0 (0x40506000)
libglib-1.2.so.0 => /usr/lib/libglib-1.2.so.0 (0x40509000)
libdl.so.2 => /lib/libdl.so.2 (0x40530000)
libXi.so.6 => /usr/X11R6/lib/libXi.so.6 (0x40533000)
libXrender.so.1 => /usr/X11R6/lib/libXrender.so.1 (0x4053b000)
libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0x40543000)
libfontconfig.so.1 => /usr/lib/libfontconfig.so.1 (0x4059a000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)
libexpat.so.0 => /usr/lib/libexpat.so.0 (0x405c5000)
|
"
Now just start Fluxbox and select "Antialias" from the configuration menu (Settings -> Configure -> Antialias) or just add the following to your ~/.fluxbox/init :
Code: |
session.screen0.antialias: true
|
If the fonts still look bad, try to change the Fluxbox Style... if you found one with a nice font, just edit the Style file and copy the font to your favorite Style. You can find the Style files in /usr/share/commonbox/styles/ . A font section normally looks like this:
Code: |
!*font: gelly
!*font: lucidasans-10
*xft.font: Arial
*xft.size: 9
menu*xft*size: 10
|
These are mine font settings in my current Fluxbox style... "gelly" is a ArtWiz font and "lucidasans" is a non-AA font. I commented these lines because I want to use the Xft fonts
If I remembered and wrote everything correct, your Fluxbox and Phoenix should look like this now: http://0x1337.net/tmp/flux.png
Next are the GTK apps... as you know AA is available in Gnome2 (GTK2) by default. But some big apps like Abiword or Gnumeric are not yet available as Gtk2 apps... but we can use a nice hack to enable AA in this apps aswell! Its called "gdkxft".
Lets emerge it:
Code: |
emerge gdkxft # my version: 1.5
|
If you dont want to install the gnome-control-center, modify your /usr/portage/x11-libs/gdkxft/gdkxft-1.5.ebuild. Below is just the part I changed. (It gives some errors about the control-center, but it works just fine):
Code: |
DEPEND="=x11-libs/gtk+-1.2*
virtual/x11"
# =gnome-base/control-center-1.4*"
src_compile() {
CPPFLAGS= ./configure \
--host=${CHOST} \
--prefix=/usr \
--infodir=/usr/share/info \
--mandir=/usr/share/man || die "./configure failed"
emake || die "compile failed"
}
|
After you installed gdkxft, create the config file /etc/gdkxft.conf :
Code: |
*
!-urw-*
!-b&h-lucidux*
!-abisource-*
!-abiword-*
!-freefont-*
!-sharefont-*
!-macromedia-*
|
The exclamation mark ("!") is the comment character here. Line with a minus ("-") in front mean "dont antialias", without means "antialias the font". As you can see, I commented each line and just left a asterisk ("*") to antialias every font.
To enable gdkxft, you need to either set LD_PRELOAD to the gdxft path:
Code: |
export LD_PRELOAD=/usr/lib/libgdkxft.so
|
Or add the path to the gdkxft library to your /etc/ld.so.preload to enable AA global.
Restart X and you should have AA fonts in every GTK1.x application now! Including Abiword! Look this screenshot for a preview how it looks here.
If you try to start a GTK2 application now (like Gedit) you will get an error that gdkxft does not work with GTK2. My workaround is, to add the export LD_PRELOAD command into my /etc/profile (I have "source /etc/profile" in my .bashrc to make sure it also gets exported in each terminal I open):
Code: |
bazik@genesis scripts $ cat /etc/profile | grep LD_
export LD_PRELOAD=/usr/lib/libgdkxft.so
bazik@genesis scripts $ cat ~/.bashrc
source /etc/profile
|
That way I can disable gdkxft just with
Code: |
export LD_PRELOAD=""
|
But because I want AA fonts in Gedit, I wrote a simple script which disables gdkxft and enables native GTK2 font rendering I just use this script now to start Gedit and it works like a charme:
Code: |
bazik@genesis scripts $ cat geditxft
#! /bin/bash
export LD_PRELOAD=""
export GDK_USE_XFT=1
gedit &
export GDK_USE_XFT=0
export LD_PRELOAD=/usr/lib/libgdkxft.so
|
You can also change this script the other way round to dynamically enable gdkxft. I use this because the majority of my GTK apps is GTK1 and only Gedit is a GTK2 app here.
Thats it! If you have any questions, just post here!
Hope this helps some of you,
bazik
It would be nice if someone can mirror the screenshots and the Xft.h because I only have a limited webspace and need to delete the files in a few days
Last edited by bazik on Thu Nov 21, 2002 11:22 pm; edited 3 times in total |
|
Back to top |
|
|
Lovechild Advocate
Joined: 17 May 2002 Posts: 2858 Location: Århus, Denmark
|
Posted: Thu Nov 21, 2002 6:18 pm Post subject: |
|
|
I can mirror your stuff.
oh and please do note that subpixel sampling only works on landscape formed LCD display.
-edit-
took matters into my own hands
xft.h.good
fluxbox screenshot 1
fluxbox screenshot 2
enjoy.
-edit2-
corrected URL for xft.h.good
Last edited by Lovechild on Thu Nov 21, 2002 6:27 pm; edited 2 times in total |
|
Back to top |
|
|
bazik Retired Dev
Joined: 22 Jul 2002 Posts: 277 Location: Behind you.
|
Posted: Thu Nov 21, 2002 6:23 pm Post subject: |
|
|
Lovechild wrote: | I can mirror your stuff, just mail me (lovechild@foolclan.com)
oh and please do note that subpixel sampling only works on landscape formed LCD display. |
Added, thanks!
I will send you the an email with the files in a few... |
|
Back to top |
|
|
Craigo Apprentice
Joined: 09 Aug 2002 Posts: 249 Location: /dev/life
|
Posted: Thu Nov 21, 2002 9:27 pm Post subject: |
|
|
And don't you mind if I 'borrow' this idea onto my site? (I will stick your name on it). Just building up a useful tips section =)
-/Craigo/- |
|
Back to top |
|
|
bazik Retired Dev
Joined: 22 Jul 2002 Posts: 277 Location: Behind you.
|
Posted: Thu Nov 21, 2002 9:32 pm Post subject: |
|
|
Craigo wrote: | And don't you mind if I 'borrow' this idea onto my site? (I will stick your name on it). Just building up a useful tips section =)
-/Craigo/- |
I have no problem with it But you should also include my email address if someone has a question about it -> bazik@0x1337.net
Please mail me the Url when you put it there... |
|
Back to top |
|
|
bazik Retired Dev
Joined: 22 Jul 2002 Posts: 277 Location: Behind you.
|
Posted: Thu Nov 21, 2002 11:23 pm Post subject: |
|
|
- Edited Gedit script (added "&"). You wouldnt have AA in GTK1 apps until you close the GTK2 app |
|
Back to top |
|
|
Pigeon Guru
Joined: 21 Jun 2002 Posts: 307
|
|
Back to top |
|
|
bazik Retired Dev
Joined: 22 Jul 2002 Posts: 277 Location: Behind you.
|
Posted: Fri Nov 22, 2002 7:58 am Post subject: |
|
|
Hehehe Well, I didnt have any problem and use gdkxft for a few days now (and tested all apps I have installed with it) and it works just fine |
|
Back to top |
|
|
bazik Retired Dev
Joined: 22 Jul 2002 Posts: 277 Location: Behind you.
|
Posted: Fri Nov 22, 2002 12:31 pm Post subject: |
|
|
If you get problems with large fonts when you activate AA in Fluxbox, read up and discuss here. |
|
Back to top |
|
|
Craigo Apprentice
Joined: 09 Aug 2002 Posts: 249 Location: /dev/life
|
Posted: Fri Nov 22, 2002 5:11 pm Post subject: |
|
|
Phoenix in AA glory!
Now how nice is that!? This is on a work machine btw =)
-/Craigo/- |
|
Back to top |
|
|
_SkeLeToN_ Guru
Joined: 12 Sep 2002 Posts: 506 Location: Montreal,Canada
|
Posted: Fri Nov 22, 2002 6:10 pm Post subject: |
|
|
The phoenix-bin release is it compile to support xft by default or I have to compile it ? ( I know the thread about compiling your own phoenix browser but since I got more problem with that I would like to use the bin) |
|
Back to top |
|
|
bazik Retired Dev
Joined: 22 Jul 2002 Posts: 277 Location: Behind you.
|
Posted: Fri Nov 22, 2002 6:18 pm Post subject: |
|
|
_SkeLeToN_ wrote: | The phoenix-bin release is it compile to support xft by default or I have to compile it ? ( I know the thread about compiling your own phoenix browser but since I got more problem with that I would like to use the bin) |
I used the binary. |
|
Back to top |
|
|
klasikahl Retired Dev
Joined: 04 Nov 2002 Posts: 118 Location: Paradise Valley, Arizona
|
|
Back to top |
|
|
prolific Apprentice
Joined: 19 Apr 2002 Posts: 237
|
Posted: Sun Nov 24, 2002 7:51 am Post subject: |
|
|
I tried to emerge gdkxft and this is what happened...
...........
/usr/X11R6/include/X11/Xft/Xft.h:380: parse error before `FT_UInt'
/usr/X11R6/include/X11/Xft/Xft.h:386: parse error before `FT_UInt'
/usr/X11R6/include/X11/Xft/Xft.h:395: parse error before `FT_UInt'
/usr/X11R6/include/X11/Xft/Xft.h:405: parse error before `XftCharIndex'
/usr/X11R6/include/X11/Xft/Xft.h:407: warning: type defaults to `int' in declaration of `XftCharIndex'
/usr/X11R6/include/X11/Xft/Xft.h:407: warning: data definition has no type or storage class
/usr/X11R6/include/X11/Xft/Xft.h:448: parse error before `FT_UInt'
/usr/X11R6/include/X11/Xft/Xft.h:459: parse error before `XftGlyphSpec'
/usr/X11R6/include/X11/Xft/Xft.h:480: parse error before `XftGlyphFontSpec'
make[1]: *** [gdkxft.lo] Error 1
make[1]: Leaving directory `/var/tmp/portage/gdkxft-1.5/work/gdkxft-1.5/src'
make: *** [all-recursive] Error 1
!!! ERROR: x11-libs/gdkxft-1.5 failed.
!!! Function src_compile, Line 6, Exitcode 2
!!! compile failed |
|
Back to top |
|
|
klasikahl Retired Dev
Joined: 04 Nov 2002 Posts: 118 Location: Paradise Valley, Arizona
|
Posted: Sun Nov 24, 2002 7:54 am Post subject: |
|
|
gdkxft isnt meant for xft2 -- i suggest waiting on those apps to come out with xft2 capabilities. if your fonts are set up properly, the non-aa fonts arent ugly (imho) |
|
Back to top |
|
|
surak n00b
Joined: 10 May 2002 Posts: 56 Location: upper-right coast
|
Posted: Sun Nov 24, 2002 1:48 pm Post subject: |
|
|
prolific, did you replace your /usr/X11R6/include/X11/Xft/Xft.h with the newer one? I had to do that to get gdkxft to compile |
|
Back to top |
|
|
nsadhal n00b
Joined: 12 Jul 2002 Posts: 34 Location: Berkeley, CA
|
Posted: Tue Nov 26, 2002 4:08 am Post subject: Fluxbox doesn't pick up fonts |
|
|
Wow, thanks for the tip, everything seems to be working well except for one little thing. Fluxbox doesn't pickup any other TTF fonts except for two... and I can't figure out where they're coming from. I just get these two ugly fonts, depending on what font is specified in the theme. It has nothing to do with xft.font, only with *.font... which means the regular X fonts, not the xft fonts...
Here are some screenshots of the fonts in case anyone recognizes them and could tell me what's going on:
http://inst.eecs.berkeley.edu/~nsadhal/fonts1.jpg
http://inst.eecs.berkeley.edu/~nsadhal/fonts2.jpg
The fonts seem to pick up in phoenix okay...
I can't even get the ms fonts like arial to work (the ones in /usr/X11R6/lib/X11/fonts/truetype)
Thanks. _________________ It makes me so mad I wanna grab my sawed off, and get some bodies hauled. |
|
Back to top |
|
|
klasikahl Retired Dev
Joined: 04 Nov 2002 Posts: 118 Location: Paradise Valley, Arizona
|
Posted: Tue Nov 26, 2002 4:28 am Post subject: |
|
|
make sure that font dir is in your X config, and in your /etc/fonts/fonts.conf -- after double checking both, run fc-cache |
|
Back to top |
|
|
nsadhal n00b
Joined: 12 Jul 2002 Posts: 34 Location: Berkeley, CA
|
Posted: Tue Nov 26, 2002 6:06 pm Post subject: |
|
|
Quote: | make sure that font dir is in your X config, and in your /etc/fonts/fonts.conf -- after double checking both, run fc-cache |
The paths were the first thing I checked... I checked them over and over, I'm pretty sure they're correct. I ran fc-cache, adn it made no difference. I still have this problem... There are three fonts available, the two you see in the screen shots and a third, smaller version of that Times one. I can't really control it though. If a certain bitmap font is specified for *.font, then I get the small one. Sometimes I'll get the larger Times one. If nothing is specified, but I switch from another theme, the new theme has the same one as the old one. If i tell fluxbox to restart, I get the Courier type font.
Again, Phoenix is able to pick up all the fonts fine (all the fonts I have appear in phoenix's drop down menu _________________ It makes me so mad I wanna grab my sawed off, and get some bodies hauled. |
|
Back to top |
|
|
bazik Retired Dev
Joined: 22 Jul 2002 Posts: 277 Location: Behind you.
|
Posted: Tue Nov 26, 2002 9:17 pm Post subject: |
|
|
I had the same problem on the newest Gentoo box I set up.
The weird but working solution was to give my user write access to the TTF and truetype directory...
(you can first try if the fonts work correct if you start fluxbox as root) |
|
Back to top |
|
|
klasikahl Retired Dev
Joined: 04 Nov 2002 Posts: 118 Location: Paradise Valley, Arizona
|
Posted: Tue Nov 26, 2002 11:14 pm Post subject: |
|
|
write access to the directory, or the directory and the files (recursively)?
(now i am interested in making my fluxbox work (openbox user )) |
|
Back to top |
|
|
nsadhal n00b
Joined: 12 Jul 2002 Posts: 34 Location: Berkeley, CA
|
Posted: Wed Nov 27, 2002 5:44 am Post subject: |
|
|
I tried running fluxbox as root, it still didn't make a difference...
Fonts like "arial" don't work... I only get those fonts in the screenshots.
I already looked at /etc/X11/XftConfig and /usr/X11R6/lib/X11/fonts/truetype/XftConfig and the font-name aliasing looks correct... I didn't modify the themes at all, and the default themes have lines in them for *xft.font... so I don't know what's up. _________________ It makes me so mad I wanna grab my sawed off, and get some bodies hauled. |
|
Back to top |
|
|
bazik Retired Dev
Joined: 22 Jul 2002 Posts: 277 Location: Behind you.
|
Posted: Wed Nov 27, 2002 6:59 am Post subject: |
|
|
nsadhal wrote: | I tried running fluxbox as root, it still didn't make a difference...
Fonts like "arial" don't work... I only get those fonts in the screenshots.
I already looked at /etc/X11/XftConfig and /usr/X11R6/lib/X11/fonts/truetype/XftConfig and the font-name aliasing looks correct... I didn't modify the themes at all, and the default themes have lines in them for *xft.font... so I don't know what's up. |
Ermm..... Xft2 uses /etc/fonts/fonts.conf and not XftConfig (<- Xft1) |
|
Back to top |
|
|
nsadhal n00b
Joined: 12 Jul 2002 Posts: 34 Location: Berkeley, CA
|
Posted: Wed Nov 27, 2002 7:08 am Post subject: |
|
|
yeah yeah
i checked fonts.conf too....
sigh... i keep forgetting to cover all my bases in my posts...
unless...
do i have to add each directory explicitly to fonts.conf?
like
<dir>/usr/X11R6/lib/X11/fonts/truetype</dir>
because at the moment i just have /usr/.../fonts.
Edit:
Okay, well I just tried that and it made no difference. _________________ It makes me so mad I wanna grab my sawed off, and get some bodies hauled. |
|
Back to top |
|
|
qnx l33t
Joined: 25 Jun 2002 Posts: 638 Location: Göteborg, Sweden
|
Posted: Sun Dec 01, 2002 3:43 pm Post subject: |
|
|
Well, I followed the guide (partly only, because I just want AA in fluxbox, not Phoenix or GTK1 apps). Fluxbox compiled well, with the new Xft.h and Xft-2.0-r1 emerged earlier. Somehow, when I enter fluxbox and choose Antialias -> true ALL text on menu and slitbar and docks any everywhere (except programs, like Opera) disappears! When I then try to click somewhere to see my menu I see nothing. Or acctually I do, but the menu-boxes are empty so they are very very small. Somebody know what's wrong???
Edit:
For all lamers like me: RESTART FLUXBOX ! _________________ Registred Linux user #191143!
Abit NF7-S rev. 2.00 (BIOS v. 2.7)
AMD AthlonXP 2500+ (Barton)
PATA Seagate ST3120022A
SATA Seagate ST3200822AS & Silicon Image 3112 chipset
Gentoo Linux |
|
Back to top |
|
|
|