This post is about installing and using the X windows font 6x13 -Misc-Fixed-Medium-R-SemiCondensed--13-120-75-75-C-60-ISO10646-1 on Ubuntu 20.04
In Ubuntu 22.04 jammy a new problem appeared, Pango insert a 2 pixels space between the lines, making the terminal windows height increase of 48 pixels (24 lines). I don't know if it is a problem in Pango or a problem in the font definition. Anyway I was lucky to found a workaround, here it is.
The procedure is close to the one I found for Ubuntu 20.04 at https://super-unix.com/ubuntu/ubuntu-how-to-activate-bitmap-fonts-on-20-04/ that worked great for 18.04 and 20.04 but showed this 2pixel gap in 22.04.
At that time we had to enable bitmap font and convert the font into OpenType Bitmap (otb) format. For 22.04 we must also tweak the font definition by moving all the characters 2 pixels up, at the level of the baseline. There is no more part of the character, like for the letter "g" below the baseline. This could be a problem when mixing the font with other fonts, but this is never happening in a terminal!
First enable the bitmap font in Ubuntu:
sudo rm /etc/fonts/conf.d/70-no-bitmaps.confsudo ln -s ../conf.avail/70-force-bitmaps.conf /etc/fonts/conf.d/sudo dpkg-reconfigure fontconfig-configsudo dpkg-reconfigure fontconfig
Download the font in BDF format :
wget https://opensource.apple.com/source/X11fonts/X11fonts-14/font-misc-misc/font-misc-misc-1.1.2/6x13.bdf
Then you must tweak the font, first by modifying its font name and then by moving character above the baseline.
sed -i 's/FAMILY_NAME.*/FAMILY_NAME "MyFixedTwo"/' 6x13.bdfsed -i 's/FONT_DESCENT 2/FONT_DESCENT 0/g' 6x13.bdfsed -i 's/FONT_ASCENT 11/FONT_ASCENT 13/g' 6x13.bdfsed -i 's/FONTBOUNDINGBOX 6 13 0 -2/FONTBOUNDINGBOX 6 13 0 0/g' 6x13.bdfsed -i 's/BBX 6 13 0 -2/BBX 6 13 0 0/g' 6x13.bdf
Finally we must convert the BDF font into the OTB format using fonttosfnt. Unfortunately the version provided with Ubuntu 22.04 is buggy, we need to install the last version from github and compile it.
sudo apt-get install build-essential xfonts-utils pkg-config libfreetype-dev libfontenc-dev x11proto-core-dev
git clone https://gitlab.freedesktop.org/xorg/app/fonttosfnt.gitcd fonttosfnt./autogen.sh./configuremakecd ..fonttosfnt/fonttosfnt -b -c -g 2 -m 2 -o myfixedtwo.otb 6x13.bdf
Install the new otb font:
sudo cp myfixedtwo.otb /usr/local/share/fontssudo dpkg-reconfigure fontconfig-configsudo dpkg-reconfigure fontconfigfc-list | grep otb
Start app, choose font, search for "myfixedtwo".