[Fontconfig] using fontconfig to work around odd vertical spacing?
Duraid Madina
duraid at octopus.com.au
Sun May 9 10:46:30 EST 2004
Hi everyone,
I recently purchased a monospaced font which seems to be
properly hinted: using GIMP (2.0.1) to render it, it looks the best (by
far) with hinting turned on but "force autohinting" turned off: I am
using freetype compiled with the truetype bytecode interpreter.
However, there's a big problem with this font. I guess screenshots
speak louder than words, so here goes:
First, some examples of the font in GIMP: everything looks OK (if I had
to be picky, I would say that having vertical spacing set to 0.0 in GIMP
makes the gap between consecutive lines of text look a *tiny* bit too
large: a vert. spacing of -2.5 or so seems to help.)
http://parallel.hpc.unsw.edu.au/~duraid/thesansmono/gimp.png
OK, so far so good. Now starts the pain (you'd be in pain too if you
just spent 100 euros on a single font
This is what 'gvim' looks like. Basically, the bottom ends of characters
such as 'g' are being chopped off; _ (underscore) is completely
invisible and '[' looks like an Asian quote mark, not a square bracket
(again, the lower half is invisible):
http://parallel.hpc.unsw.edu.au/~duraid/thesansmono/gvim.png
Finally, we descend into hell. gnome-terminal and rxvt-unicode both
completely choke on this font's vertical spacing:
http://parallel.hpc.unsw.edu.au/~duraid/thesansmono/gnome-terminal.png
http://parallel.hpc.unsw.edu.au/~duraid/thesansmono/rxvt-unicode1.png
http://parallel.hpc.unsw.edu.au/~duraid/thesansmono/rxvt-unicode2.png
(this is the rxvt-unicode invocation: rxvt-unicode -bg black -fg gray
-cr green -sb -sl 1000 -fn "xft:TheSansMono Office:pixelsize=14",
gnome-terminal is set through it's configuration menus to use the font
at size 9)
And just a moment ago I noticed that in this mozilla window, the text
dances around a little each time I hit a newline. If you take a look at
the bottom line of this screenshot:
http://parallel.hpc.unsw.edu.au/~duraid/thesansmono/mozilla.png
you'll see the 'y' is chopped off. Either making the window lose focus
and regain focus or simply hitting enter and then backspace (to go back
up a line) is enough to make the 'y' appear completely. (note: it
actually is all the lines in the window that change, not just the bottom
line of text.
Well, to my question: I'm wondering, is there any way I can use
fontconfig to force the vertical spacing of this font to some particular
value? As you can probably tell, I'm not sure if this is even a
reasonable question to ask: perhaps this is a bug in freetype, but then
I'd wonder how GIMP renders it properly, and indeed with quite
reasonable (ample) vertical spacing when the vertical spacing is set to
zero there.
Interestingly, attempting to use this font in abiword leads to a kind of
livelock: I can select the font for use, but as soon as I enter a single
character, both abiword and XFree86 proceed to consume 100% of CPU time.
A bit of a worry, but I don't really care about abiword, vim and
gnome-terminal are much more important for me.
If any of you kind souls have any words of advice on how I might be able
to get this font working properly, or how I can help debug/report the
problem (should I mention this to freetype? ask the GIMP guys for help?)
I would be most grateful.
Many thanks in advance,
Duraid
P.S. For what it's worth, the font is listed by its vendor as being a
"Windows TrueType" font: there is no Macintosh version available.
More information about the Fontconfig
mailing list