Figuring Out the Font System on Linux Desktops?
koreth asks: "Last year I switched to Debian sarge on my office desktop machine. For the most part it's been great, but I can't seem to wrap my brain around fonts. For example, my favorite programming font is Sheldon Narrow. After running it through a few conversion tools and copying it to various font directories, I was able to start using it in xterm. But no sign of it in Konsole, despite running it through KDE's font installer tool. A few times I've installed new fonts that appear in the font lists of GNOME apps but not KDE apps or vice versa, and it's unclear to me how either environment's fonts interact with what I see when I run 'xlsfonts'. I have yet to find any documentation describing how either GNOME or KDE decides which fonts it likes. And then there's Debian's 'defoma', which seems to interact with everything somehow. Are there any good resources out there for learning what's going on under the hood of a modern Linux desktop environment's font subsystem?"
Head - meet Wall
Repeat.
(n/t)
So I really can't help you. I like to worry about one thing at a time. When I first started using linux as a desktop machine in 1999, I worried about copy and paste. Fast forward 6 years, and I am still worrying about it.
The Linux Documentation Project is a good place to start. Here is an article about the optimal use of fonts. It has a section called "Why Fonts on Linux Aren't Straight Forward?" and a section called "The Easy Steps to Enlighten Your Desktop" with KDE, Gnome, OpenOffice.org, and FireFox configuration examples.
One of the things that helped me install fonts is this paper. Yes, it's from the FreeBSD handbook, but nearly all of it deals with just X11 and not FreeBSD-specific.
A few little tips; you might want to install the Microsoft web fonts (they're free as in beer and pretty nice) as well as the Bitstream Vera fonts. If you have a Windows box, you can copy those fonts, put them on your *nix box, and update the fonts database by typing ttmkfdir > fonts.dir where the TrueType fonts are stored.
Pretty much, my experience with fonts have been, for the most part, pretty good. I'm using FreeBSD with Window Maker, so no, I don't have all of the nice KDE/GNOME bells and whistles, so my fonts might not look as good. However, it is a great idea to get a nice understanding of how fonts work under X11. You never know when you need it....
As for the Sheldon font, X11 comes with a program called xfontsel. (Yes, it's ugly and it comes from the bad old days of X, and its description of fonts is a stark departure from Windows/Mac, but it does the job). Anyways, look under the fmly menu and see if your font is located there.
http://forum.tobiasjung.net/showthread.php?fid=25& tid=93&old_block=0
Chris "Ng" Jones
cmsj@tenshu.net
www.tenshu.net
There basically two font subsystems on X, the old X core fonts and the new fontconfig.
:)
/etc/fonts/local.xml.
.fon files are supported, so you don't even need to convert them.
X core fonts are the old standard X11 stuff, with FonthPaths, fonts.dir and fonts.scale files, and lots of other nastiness. It has trouble with scalable fonts, it can't deal at all with complex scripts (such as Syriac or Indic scripts), and it can't do anti-aliasing or sub-pixel rendering ("ClearType"). Also it's completely useless if you want to print something.
The new way, with fontconfig, is completely seperate (and in fact independent from X) and basically fixes all these flaws (but it introduces the nastiness of XML config files). By now the only interesting application that hasn't been converted yet is Emacs.
(I say "with fontconfig", but it actually consists of three parts: fontconfig, which keeps a database of fonts; freetype, which renders them; and xft, which connects it all with X.)
Now defoma. Defoma is something Debian specific. It's used by Debian font packages to register themselves with every font-using thing installed. As you look at the list of limitations of X core fonts, you can imagine quite a lot of programs have grown their own font systems. I don't think anybody really understands how defoma works, and you can safely ignore it.
To get a bit more concrete: you have successfully configured the X core fonts system to use your font, and discoverd pretty much nothing uses it anymore
To install a font, the modern Linux way, drop it in the ~/.fonts directory (create the directory if it doesn't exist yet). Or, alternatively, add the directory where you put the font to
BTW, I think Windows
dpkg-reconfigure fontconfig, and choose "yes" when asked about bitmapped fonts.
It's a good idea to install the x-ttcidfont.conf (or whatever it's called) package and follow the directions in /usr/share/doc/x-ttcidfont-conf/README.Debian.
Other than that, I recommend you don't try to understand the font mechanisms, but just try to forget they're there; it's easier that way.
"That's all I have to say about that" --Forrest Gump
For a resolution of 1280x960, aiming for 96 DPI gets you 25.4*1280/96 = 339 mm and 25.4*960/96 = 254 mm (gee, that was a hard equation!
To see your current DPI settings, open an xterm and type "xdpyinfo|grep inch" (or is it "Inch"?)
What time is it/will be over there? Check with my iPhone app!
And in any event even if there were a version of the right font, that wouldn't help me know what to do the next time I came across a font that didn't work. Which is really the larger point of the posting here.
There's nothing going on under the hood. Or, there's everything. It's not likely anyone will ever figure it out, because it's a freaking MESS.
"Champagne for my real friends - and real pain for my sham friends!" http://ericblade.postalboard.com/
I, for one, expect the S/N ratio of this whole thread to be 0.0001
So you decide to lower it yourself, smooth move.
BTW, thanks for the link. I didn't see a link for Sheldon in TTF format, but ProFont looks quite nice in my Gnome Terminal!
Clickety Click
This may be of some use:
t ml
;-)
http://xorg.freedesktop.org/X11R6.8.2/doc/fonts.h
These may help with your next question
http://www.cl.cam.ac.uk/~mgk25/unicode.html
http://www.gentoo.org/doc/en/utf-8.xml
I have toyed with an idea of a story, which starts from a keypress, goes on to keyboard driver, Unix tty subsystem and character coding. One story line branches to the handling of characters in the console subsystem and its fonts (in ROM or somewhere else?). The frame buffer and a graphical console are another avenue that needs to be handled. Finally the glorious or ("goreous") story line branches to X client, X primitives, X server, X character coding, X font files, X rendering, X color maps and resolutions and finally to screen pixel technology.
Especially the FILES section of the story would be interesting. I would like to see a complete list of all possible configuration files and font files which can have an effect on a character/font you see on your screen when you press a key. We can limit ourselves to a case of a dozen well-known applications.
Anssi Porttikivi / app@iki.fi
Just put your new fonts to ~/.fonts directory.
Duh, just use the FontBook. Oh wait...
Elektra is trying to put each configuration value into a sepearte file, named by the key, which is the correct way to use a file system. Unfortunatley both Unix/Linux and Windows have file systems designed to assumme that the average file is much larger than 1K, this is the real reason that this was not done and we have monstrosities like the registry, gconf, and the larger /etc files. The ReiserFS attempts to address this by being designed to support very small files efficiently.
Elektra is still screwed up, though. It is not XML, but the files have some structure to them, such as the ability to add comments. The files should be exactly the bytes of data of the value. Comments could be done by adding another file with another key, perhaps "keyname.comment".
Use KDE's font installer to install and manage fonts, it just works. Handles TrueType and Type 1 fonts, just drag and drop to install.
There's TeX and LaTeX and METAFONT... but for those, I suggest you use pdftex and pdflatex and use Type 1 fonts, rather than going through the whole "building multiple sizes of METAFONT-rendered bitmaps" thing. Ideally, use the native PDF fonts to keep your PDFs down in size.
There are also various old bitmap X fonts hanging around on my system. I don't deliberately use any of them, but I leave 'em there in case there are applications I need that don't handle scaleable TTF/Type1 yet.
GCHQ Quantum Insert installed. If only our tongues were made of glass, how much more careful we would be when we speak
KDE does not "just work" as you say. I've spent some time with current Suse and Mandrake distros and given up after being unable to get fonts properly recognized.
One big problem is that KDE's font manager (whatever it's called) doesn't recognize font families and font relationships properly. So if I installed something with book, medium, bold, extra bold, italic, and so on, only one of those fonts (at random) would usually show up in an application. Gee, it's really great to be limited to the bold italic of every font family I install.
Also, Linux needs a proper Unicode or AAT engine. I don't think it has one yet, since I've never gotten the special features of Unicode fonts to work.
(So yes, I gave up and bought a Mac.)
He who lights his taper at mine, receives light without darkening me.
xlsfonts will list fonts available under the old X11 fonts system, and fc-list will list fonts available to Fontconfig.
xfontsel also has a fontconfig equivalent: gtk2fontsel.