Bitmap fonts (PCF/BDF) support with Pango - Desktop Customization & Workflow

Users browsing this thread: 1 Guest(s)
movq
Long time nixers
I’m still getting spacing issues when bitmap fonts are embedded in OTB. I’m seeing this with qsqs, but also with popular fonts like Terminus.

Pango applications get it right: My 7x15 really is 7 pixels wide. But “older” applications, which use Xft directly, produce glyphs that are 8 pixels wide. One too many. Sadly, as soon as an OTB file is installed, it will be picked up by Xft applications, too, even though they could still handle BDF/PCF (as of September 2020).

I still haven’t figured out what exactly goes wrong. For the moment, a workaround is to fake the font’s width:

Code:
%.otb: %.bdf
    sed 's/^DWIDTH 7/DWIDTH 6/' < $< > temp.bdf
    fontforge -c 'open(argv[1]).generate(argv[2])' temp.bdf $@
    rm temp.bdf

This reduces the “device width” (i.e., pixels) from 7 to 6 for my font. It does not touch the “scalable width” (i.e., points). Pango appears to be using only SWIDTH and Xft uses only DWIDTH? I’m not sure. Either way, the same font file now shows up correctly in both GTK/Pango and Xft.

I hope to find a proper solution for this one day …


Messages In This Thread
RE: Bitmap fonts (PCF/BDF) support with Pango - by movq - 23-09-2020, 10:40 AM