Tuesday, June 26, 2007

Death to xfs

That's xfs the X font server, I have no beef with the xfs filesystem. We've been using xfs for core fonts[1] since Red Hat 6, mainly because we've had the chkfontpath tool for editing the xfs config file and restarting xfs. This tool lets us add and remove new font directories to the xfs config file and restarts xfs when necessary, so that a running X server will pick up new fonts as new font packages are installed.

While all that is nice, it's a pretty weak reason for running an system daemon, considering the maintenance overhead, security problems and boot time slowdown. So to get the best of both worlds, I wrote a patch to libXfont (which is what xfs and the X server uses for locating and rendering fonts) to let it pick up fonts paths in a rc.d style way. Instead of relying on a config file for the font path, you can now additionally redirect to a directory of symlinks, such as /etc/X11/fontpath.d. The symlinks point to the directories that make up the font path and the symlink names can include attributes such as :unscsaled. libXfont will automatically detect when links are added and removed and rescan the directory.

No, core fonts are not going away. We can't ever do that, to much legacy. But since Fedora have the two required core fonts ("misc" and "cursor") compiled into the X server, you can have a usable setup with no core fonts (say, maybe you don't like bitmap fonts, or maybe you're OLPC), no xfs, no chkfontpath installed. And at the same time, if you must have that belowed bitmap courier in your terminal or are stuck with an old motif app, install the core font you need and it will just work.

[1] Core fonts is the font mechanism originally designed into the X server. The X server locates and renders the fonts on behalf of the client. This requires the X server to know about parsing font files, glyph rendering and arbitrary encodings, which you typically would want to keep out of a priviledged process. Modern applications locate fonts using fontconfig, render glyphs using freetype, and only upload the resulting images to the RENDER extension.

9 comments:

ahe said...

Courier bitmap rulez.

Anonymous said...

xfs, RIP.

Anonymous said...

You can alter and rescan the core font path with xset fp.

Kristian Høgsberg said...

Paul, xset solves a different problem. It requires a running X server and when you restart the X server, the font path setting is reverted to the default. Both problems make the xset approach not usable in an rpm install/upgrade case.

Anonymous said...

Fuck where is the example of new xorg.conf
maybe can help me
btw
rpm -e xorg-x11-xfs
error: Failed dependencies:
xfs is needed by (installed) chkfontpath-1.10.1-2.fc8.x86_64

Anonymous said...

ok respond to my self
now , I can clean File section !
X will say:
(==) No FontPath specified. Using compiled-in default.
(==) FontPath set to:
catalogue:/etc/X11/fontpath.d,
built-ins
(==) RgbPath set to "/usr/share/X11/rgb"
(==) ModulePath set to "/usr/lib/xorg/modules"

cool !

Unknown said...

I upgraded my fc from 6 and now using 8 and I wasn't impressed with this change. At no point was I warned what would happen and my installed xfs continued to run as it always did. a while back, many of the updates started causing my software to fal with mysterious errors about xfc libX11 lock files gdk-ERROR etc and it wasn't unitl I found this page that I realised xfs wasn't required any longer. I uninstalled it and after restarting X all my app now function properly.

I understand that xfs wasn't such a good thing but it worked for me before until now. How will fontpackage installer know what pri value to give their link. If they don't give it one then it will override all the installed values.

Where exactly is the documenttation on this. A man page would be nice. None in my instlled libXfont packages.

Other than this I have no objections and it seems to be an improvement, thanks

Anonymous said...

I can't believe what a timesink FC8 has been to get the NVIDIA 7150 chip on my new XFX mobo to work with X11. And as soon as that worked (god knows if I'll ever be able to repeat what I did) now I'm spending hours trying to figure out how to install a font (in this case Bitstream Vera, which Google Earth seems to want). Where is the documentation for this? Whatever happened to the good old Redhat that used to install so smoothly? I'm really fed up with how FC has gone to hell in a handbasket.

Vaughan Pratt
Linux user 119 in the Linux Counter

Anonymous said...

I spent another hour searching the web for a hint as to how to install .ttf fonts, without success. So next I stared at /etc/fonts/fonts.conf until I noticed dir ~/.fonts /dir. Aha, maybe if I simply create that directory, manually move the .ttf files into it, and ctrl-alt-backspace the server? Joy unbounded, now Bitstream Vera shows up in System > Preferences > Look and Feel > Appearance > Fonts > Details > Go to Fonts Folder (no doubt there's a shorter path somewhere).

It would be really nice if there were a manual that is both easy to find and contains this sort of useful information !