== The drawback of modern X font handling gets mysterious Back in [[The drawback of modern X font handling ../unix/ModernXFontDrawback]] I covered how modern X font rendering happens in the client and so can vary from client to client, going from nice on one client to bad on another. I illustrated this with _xterm_ on Fedora and Ubuntu displaying the same font, Fedora well and Ubuntu badly. I now have a good reason to change to using _xterm_ with modern fonts, so I spent part of today poking at this issue; the results have turned this into a genuine peculiar mystery. What I have so far: * the problem does not happen with all programs on Ubuntu. So far _xterm_ and GNU Emacs have the bad font rendering, but Firefox, gnome-terminal, and TK-based programs such as _exmh_ and [[tkmsg ../programming/TKLike]] do not; they render DejaVu Sans Mono just like Fedora does. * the problem only happens with some monospace fonts, not all of them. The Ubuntu machine I was testing on has 11 candidate fonts listed by '_fc-list :scalable=true:spacing=mono: family_'; seven of them show the problem but four do not. (The good four are TlwgMono, Tlwg Typo, Courier New, and FreeMono. Unfortunately my preferred xterm font is DejaVu Sans Mono.) * the problem is not the Ubuntu version of xterm, the Ubuntu app-defaults file for xterm, or even the Ubuntu Freetype library; I have built the Fedora xterm and [[my version of Freetype NiceTrueTypeFonts]] on Ubuntu and used the Fedora app-defaults, and the bad rendering is still there. * I've directly set several fontconfig font rendering options that might be doing this without changing anything; at this point I haven't seen any difference with _autohint_, _weight_, _embolden_, or _aspect_ (the last was a wild shot). Similarly, Xft X resources ([[cf http://freedesktop.org/wiki/ScreenFontSettings]]) do nothing that I can see. (Forcing _autohint=true_ actually makes the Fedora font rendering slightly but visibly darker while leaving the Ubuntu rendering unchanged for both the good and bad programs.) * the problem doesn't happen with xterm on some FreeBSD machines I have handy; they render DejaVu Sans Mono the good way. Clearly something mysterious is happening in the depths of the Ubuntu version of Xft or something it calls, but only if it's invoked in the right (or wrong) way. Unfortunately I don't think there's any good way for non-experts to see what font rendering choices are being made (the fontconfig library can be coaxed into some debugging output, but it's pretty much 'exports only' from what I can see), so I have no idea if I'll be able to figure out a solution that lets me use the font I want. (Changing to gnome-terminal is not a solution for me.)