After installing my bython interface on my system I discoverd it used Xterm by default. Xterm by default uses a tiny font that makes it difficult to read. So I set up the configuration by default to use DejaVu Sans Mono at 18 pt in size, which makes it easy to read without my reading glasses.
The following is a step by step instructions on what you need to do make changes to your Xterm configuration.
Backup the current Xterm Configuration.
Backing up the current configuration to a text file
First before starting to configuring the Xterm defalut settings, you should make a backup. To do this enter in
xrdb -query > xConfig.bak
to make a backup in a file named xConfig.bak
This file can also can be used to make individual changes to settings. For example if you only want to make changes to your font size without losing your configuration on everything else. I will show you how to do this by the following
backup the configuration to a text file.
deleting the configuration (if you didn't the new changes would be appended/merged and may cause a conflict)
edit changes in a copy of the backup text file (This keeps the original backup from being corrupted)
set configuration from the edited text file.
Setting up a default bitmap font for Xterm
First you will need to get a list of legitimate font names on your system that you can use with Xterm.
You need to enter in the following command into a terminal.
xlsfonts >xlsfonts.txt
Then afterwards open xlsfont.txt (the file you just created with the xlsfonts command) to view a list of legitimate fonts usable by xterm.
Below is a partial sample of the list from my system.
-bitstream-bitstream charter-medium-i-normal--0-0-0-0-p-0-ascii-0
-bitstream-bitstream charter-medium-i-normal--0-0-0-0-p-0-iso10646-1
-bitstream-bitstream charter-medium-i-normal--0-0-0-0-p-0-iso8859-1
-bitstream-bitstream charter-medium-r-normal--0-0-0-0-p-0-adobe-standard
-bitstream-courier 10 pitch-bold-i-normal--0-0-0-0-m-0-adobe-standard
-bitstream-courier 10 pitch-bold-i-normal--0-0-0-0-m-0-ascii-0
-bitstream-courier 10 pitch-bold-i-normal--0-0-0-0-m-0-iso10646-1
-bitstream-courier 10 pitch-bold-i-normal--0-0-0-0-m-0-iso8859-1
10x20
12x24
12x24kana
12x24romankana
5x7
5x8
6x10
6x12
6x13
6x13
6x13bold
6x9
7x13
7x13bold
7x13euro
7x13eurobold
7x14
7x14bold
8x13
8x13bold
8x16
8x16kana
8x16romankana
9x15
9x15bold
a14
cursor
fixed
Open the xlsfont.txt text file in a text editor like gedit or pluma. You can go ahead and open the text file with your configuration in another tab.
Below is a image of my pluma text editor with both text files loaded. The Xdefaults is the copy of my xConfig.bak. By doing it this way you can
copy a name of a font and paste it into the configuration file and then save it.
To make an entry for the bitmapped font enter in the the line:
xterm*font: [PASTE NAME OF SELECTED FONT EXACTLY AS IT IS IN THE YOUR xlsfonts.txt FILE YOU MADED]
For example if I was to select the first font in the sample list I shown it would look like the following.
xterm*font: -bitstream-bitstream charter-bold-r-normal--0-0-0-0-p-0-ascii-0
Afterwards save the Xdefaults file. Then run the following commands in a terminal
xrdb -remove This deletes the current configuration
xrdb -merge ~/.Xdefaults This replaces the configuration with the contents of the text file .Xdefaults The ~/ is assuming
the .Xdefaults file is in your home folder.
Now all you have to do is run xterm to check the results. If the new font isn't to your expectations, you can then repeat the procedure with a different bitmapped font.
Using a TrueType font by default.
It is best to use a fix ed width truetype font. To find what is the default TrueType font that is matched with the name mono just enter in the following command:
fc-match mono This will show you the best fixed TT font to use.
When I ran the command on my system I was presented with
DejaVuSansMono.ttf: "DejaVu Sans Mono" "Book"
So for my system I put the following lines into my configuration.
xterm*faceName: DejaVu Sans Mono
xterm*faceSize: 18
I wanted my font large enough to where I am working in my bpython window I didn't have to wear my glasses so I set it to 18 points.
Once again I saved the text file to .Xdefaults and then ran the following commands.
xrdb -remove To delete the current configuration
xrdb -merge ~/.Xdefaults To replace(update) the configuration with the contents of the text file .Xdefaults
The first time I ran the xterm I was greeted with the same tiny font as before. I went to the menu (by holding the Ctrl key and clicking with the right button in the xterm window) and check marked TrueType Fonts in the menu. This changed the xterm window to the desired DejaVu Sans Mono font. But I wanted it to startup with this font. After a little debugging my configuration I discovered my mistake. When I entered the faceName: into the config file, I had first typed it as facename:. Xterm's configuration file is case sensitive and by making the "N" in faceName a small letter caused it to be ignored. After I capitalized the "N", the font was what I expected on startup.
Below is the xterm window I was greeted with with the facename error.
Below is the desired result after I changed facename to faceName in the configuration. I did not have to check TrueType Fonts in the menu.
below is my bpthon window
End of xterm font tips