Re: [dev] [patch] dmenu - support for xft font rendering

From: Kris Maglione <maglione.k_AT_gmail.com>
Date: Sun, 5 Sep 2010 22:53:33 -0400

On Mon, Sep 06, 2010 at 02:20:47AM +0100, Ethan Grammatikidis wrote:
>
> On 1 Sep 2010, at 8:30 pm, Kris Maglione wrote:
>
>> On Wed, Sep 01, 2010 at 06:00:17PM +0100, Ethan Grammatikidis wrote:
>>> Connor Lane Smith wrote:
>>>> If someone were to write a simple clean xft patch for libdraw it
>>>> could be useful, perhaps even integrated into mainline.
>>> This may just be my limited perspective, or it may be my upset
>>> stomach talking, but I'm very surprised to see xft seriously
>>> suggested in this mailing list. Xft is (to me) synonymous with the
>>> transition of X.org from something bad but usable into a black box
>>> nightmare best left to distro tools to cope with. Maybe it wasn't so
>>> bad for other people, maybe it got better.
>>
>> As bad as Xft/fontconfig is, the X font system is worse. At least with
>> Xft, you can copy just about any font you like (TTF, OTF, Type-1, PCF,
>> BDF) to ~/.fonts and then use it. You also don't need to worry about
>> having scaled bitmaps for every font size that you want. And, probably
>> most importantly, you don't need to deal with hoary and inscrutable X
>> font spec strings.
>
> cd .fonts
> mkfontdir
> xset +fp ~/.fonts # or if you ran that already: xset fp rehash
>
> Granted, xset not a wonderful program itself, being essentially a
> multi-call binary with a number of entirely unrelated tasks and no
> syntax consistency whatsoever.
>
> Scaled bitmaps are an issue for the web, certainly. I've never
> personally needed them elsewhere except in apps I'd really describe as
> having brain-damaged UIs. I would like to have web pages rendered in such
> a way as to not need precise font sizes.

You're not considering the fact that a) that won't work if
you're connecting over a network, b) you can't use scalable
fonts without a font server, c) quite a few other problems that
I can't think of off of the top of my head but bite from time to
time.

> Speaking of UIs, good ones can make excellent tutorials. 10-20 minutes
> with xfontsel and X font spec strings look a whole lot better. They may
> still be a little hard to hand-edit but not entirely so and xfontsel
> itself is a pretty good tool for when they are. After using xfontsel for
> years the Gtk+2 font selector's lack of any means to filter the font list
> was unbearable! Honestly, that lack of filtering was one of the bigger
> things turning me off Xft, and I don't know if the situation's improved.

That's no excuse for the absolutely appalling specification
format. Fontconfig may be a reeking pile of insanity, but at
least you can read its specs. Usually a font name by itself is
enough, or with a size, 'Terminus - 12', and beyond that, it's
still easy enough to parse:

   Terminus:style=Bold:pixelsize=12:charset=iso10646-1

as opposed to

   -*-terminus-bold-*-*-*-12-*-*-*-*-*-iso10646-1

Also note that the charset is almost entirely superfluous in the
first spec, but the second is a crap shoot without it.
And at least with the former you can run 'fc-list | grep Terminus'
to get a list of the available opts. Try grepping 'xlsfonts -l'
some time. On my machine, it freezes my X server for 30 seconds,
prints a few hundred lines to TTYv1, and finally returnes a few
hundred lines of similarly inscrutable font specs for each font.
I still say that fontconfig is crap, but it's certainly less
crap than the X font system, if only it weren't for the damned
XML configuration garbage.

> I'm not really trying to advocate X font strings as such, nor Xlib; one
> of my monitors really needs anti-aliasing and UTF-8 support is a good
> thing, referring to your comment below. I'm not sure what I am getting
> at.

I use Xft with wmii wihout antialiasing, because I do need UTF-8
support and the X font system doesn't get it right for me. And
I'm tired of dealing with those blighted font specs.

-- 
Kris Maglione
The pessimist complains about the wind; the optimist expects it to
change; the realist adjusts the sails.
	--William Arthur Ward
Received on Mon Sep 06 2010 - 04:53:33 CEST

This archive was generated by hypermail 2.2.0 : Mon Sep 06 2010 - 05:00:04 CEST