Sam Trenholme's webpage
Support this website

New Cousine/MSYS font

 

December 15 2013

I have converted the 7x14 version of the misc-fixed bitmap font to a Windows-compatible version that both PuTTY and MSYS can use.

==Downloading and installing==

The font can be downloaded here:

http://samiam.org/fonts/terminal/misc-fixed/m7x14.fon
After downloading, to install in Windows, double click on the font (m7x14) then click on the button in the font preview window marked “install”.

==Using the font in PuTTY==

After the font has been installed, in PuTTY one can change the font used for a terminal session by going to Window -> Appearance and clicking on the button marked “change” to the right of where it says “Font”.

Select the font “m7x14” in the menu on the left then click on “OK”.

To save these settings, click on “Session”, put a name in the box for “Saved Sessions”, then click on “Save”.

==Using the font in MSYS==

In MSYS 1.0.10 (which is available for download right here), one changes the font by editing the file msys.bat. In that file, there is a line that looks like this:

start rxvt -backspacekey ^H -sl 2500 -fg %FGCOLOR% -bg %BGCOLOR% -sr -fn Courier -12 -tn msys -geometry 80x25 -e /bin/sh --login -i

Change the line to look like this:

start rxvt -backspacekey ^H -sl 2500 -fg %FGCOLOR% -bg %BGCOLOR% -sr -fn m7x14 -tn msys -geometry 82x25 -e /bin/sh --login -i

It’s possible to choose colors here. For example, green on black:

start rxvt -backspacekey ^H -sl 2500 -fg #00d000 -bg #000000 -sr -fn m7x14 -tn msys -geometry 82x25 -e /bin/sh --login -i

Note that the ^H is a literal ctrl-H character.

Once this is done, MSYS should restart using the 7x14 font. Two things to note:

  • The “-fn m7x14” part chooses which font MSYS starts with
  • The geometry is 82x25 because a RXVT’s code for calculating the screen size is buggy; the resulting window is 80x25

==How I made the font==

First I went to the current page for the misc-fixed fonts and downloaded the most recent version of the fonts. The source font I used was 7x14; its source file is 7x14.bdf, which can be seen here:

http://samiam.org/fonts/terminal/misc-fixed/
I then opened up the font in FontForge, and exported the font as a Winwdows .fnt file.

Once I had the Windows .fnt file, I used Simon Tatham’s dewinfont.py tool to convert the font in to a “.fd” file. Once I had the fd file, I had to make sure of the following:

  • The font needs the line near the top with the charset to say “charset 0”, otherwise MSYS will be unable to open the font
  • To avoid looking buggy in MSYS’ RXVT client, I had to make sure the letters had no pixels in the leftmost column of the font. 7x14 comes from upstream “left aligned” (the blank pixel separing characters is on the right size of the font); I used a Perl script to make the letters “right aligned”, by moving all characters one pixel to the right, discarding the blank right column, and inserting a blank column on the left hand side.
  • The RXVT included with MSYS will not open a font whose name starts with a number. This is why the font is called “m7x14” instead of “7x14”.
  • All of the characters needed to have the same width (no “width 0” characters), or PuTTY would refuse to open the font.

Once all that was done, I used Simon’s mkwinfont.py script to convert the .fd file in a to the final Windows .fon file.

Simon’s tools can be downloaded here:

http://www.chiark.greenend.org.uk/~sgtatham/fonts/
I have made a mirror here:

http://samiam.org/fonts/terminal/Simon-Tatham/
==Conclusion==

While bitmapped fonts will become obsolete once retina displays are universal (probably within 10 years), it’s nice to be able to use a font I have been using since 1995 with all of my Windows terminal applications.

To post a comment about this blog entry, go to the forum (self-signed https). New accounts may post once I approve the account.