Eureka Moment – Fonts on Arch Linux

Published on March 25, 2023 at 9:22 am by LEW

Introduction

As part of an Arch Linux Based ultralight desktop, I was doing some testing with xdm/xmessage for a very light display manager when I suddenly had a Eureka moment. I have been struggling, unsuccessfully with changing display fonts. In a moment of sudden insight I solved my perplexing  font problem.Basically I am using xdm as my display manager, and wanted to use xmessage to add just a little bit of functionality. The problem was the size of the font in xmessage. It was tiny, especially on a high resolution display. And seemed unable, for the longest time to change that font in  any way shape or form. Then I had my Eureka moment.

The Problem

xmessage is a very old application for displaying messages on a display. You can use it to add buttons and messages to any root display, even the Display Manager (DM). The X Display Manager (xdm) is what comes default with X on Linux. It is very light and a bit to minimalistic. Of course there are other choices, SDDM and LightDM come to mind as some of the more common ones. Most modern display managers have a lot of features, and on modern hardware one would not notice a difference. However I am developing this Graphical User interface (GUI) for older hardware where there is a obvious difference. Besides I have never been one for the easy road.

The problem I was having with xmessage was trying to change the font, and having no luck at all. The xmessage program is old and relies on bit-mapped fonts and the old X windows font system. However it has the features I wanted and none of the extra weight.

My first thought was to use another program. A few I  of the options I looked at where dialog, Xdialog, gxmessage, and zenity. None of them where exactly right for what I wanted to do. So it was back to trying to change the font in xmessage.

In the process I went through a number of helper programs, like xfonsel, xlsfonts, mkfontscale, mkfontdir, etc. I also learned a great deal about how fonts work on Arch Linx. My issue was that I knew there where a number of bit-mapped fonts installed by default, but I was unable to access them using Xresources for xmessage. I played around for hours with the fourteen part font names of the old X Font system with no luck whatsoever.

The Solution

This morning it hit me like a thunderbolt out of the blue. The bitmapped fonts are in a totally different directory that was never in my font path.

If you install fonts, and they do not end up in your home directory,  they generally end up in /usr/share/fonts. If you are using a xorg.conf file, that path is probably listed several times for all the font sub directories in that folder. All well and good as it is suppose to be.

What was not listed in my xorg.conf was the /usr/share/kbd/consolefonts folder, where all the console bit-mapped fonts are stored.

Once I added this folder to my xorg.conf file, everything just started to work as it was suppose too.

Conclusion

What I discovered here might seem obvious to some, but it was kicking me for days. And I noted in my search for a solution that other people seem to be having similar problems. So I hope this helps some of you.  I have found working with different font systems on the same platform can bed very frustrating at times.,

I should note that this is on a Arch based system, and may not exactly apply to non Arch distributions.

 

Add New Comment

Your email address will not be published. Required fields are marked *