For better or for worse, many of us have become accustomed to the 6x13 font that has been the default bitmap font for xterm for many years.
Newer terminal programs like gnome-terminal give us updated configuration GUIs, as well as useful features like profiles and ability to directly click on URLs. But because of the font configuration mess on Ubuntu, it's impossible, with default settings, to get gnome terminal to use the same 6x13 font. The instructions below illustrate how to fix this situation (aside from just using xterm).
Firstly, bitmap fonts need to be enabled through the fontconfig system. To do this, open up a terminal, and run the command:
sudo dpkg-reconfigure fontconfig-config
In the prompts that follow, be sure to say yes to the 3rd prompt, about enabling bitmap fonts by default. Next, issue the command
sudo fc-cache -fv
To make sure your font caches are refreshed. Doing so allows the standard X11 bitmap fonts to be made available to various applications that use the fontconfig system (notably, all gnome apps that use gtk2) (Note, also, that they will first need to be restarted). However, while a 'Fixed' entry does show up in the font selection dialog in gnome-terminal, it is impossible to actually sepcify the right set of parameters to get the same font as 6x13. This is where a little .fonts.conf magic comes in. In ~/.fonts.conf Insert the following block:
<match target="pattern">
<test name="family"><string>MiscFixed13</string></test>
<edit name="family"><string>Fixed</string></edit>
<edit name="foundry"><string>Misc</string></edit>
<edit name="style"><string>SemiCondensed</string></edit>
<edit name="dpi"><int>75</int></edit>
<edit name="pixelsize"><int>13</int></edit>
</match>
This causes the font system to recognize a special font "pattern" (i.e. specification, what apps use as input to the font system to find particular fonts) which is aliased to the exact parameters that specify the 6x13 font. Note that the important parts of this specification are the "foundry", as well as "style", and "pixelsize")
With this done, still one problem remains: this custom "pattern" cannot be specified directly through the standard font configuration dialog. Next, we must use gconf-editor to edit your gnome-terminal profile to actually request this special parameter.
Fire up gconf-editor and navigate to the key /apps/gnome-terminal/profiles/XXXX where XXXX is the profile you want to edit, and find the 'font' key. By manually editing this field, you can specify any font pattern to be passed to the fontconfig system. In this case, change the value of the key to 'MiscFixed13 10'. The '10' in this case is the size specification, but is ignored because the above fonts.conf specification sets a pixelsize manually.
As soon as this key is set, you should notice that any open gnome-terminals using this profile will now start using the new font. (Note, you do have to restart gnome-terminal after editing the .fonts.conf first, otherwise the new settings will not have been reflected)
Edit: Added note about the use of "fc-cache". Thanks pmorch!
Comments
Need to run "fc-cache -f" too...
Hi,
Thanks for this tip! However, I've found that after running
sudo dpkg-reconfigure fontconfig-configto enable bitmap fonts, I needed to run this also:sudo fc-cache -fto update the font cache (or something).
Otherwise the font didn't show up.
Peter