NexusFont

WebHome | UnixGeekTools | Geekfarm | About This Site

Pointers

The nexus font is my favorite pixel font!

Success! 21 May 2005 - 08:35 GMT

After lots of trying, I was finally able to convert the nexus font to a format that is usable on OS X! Just install the font, and make sure to set the size to 10pt.

Here's the .bdf version of this font, which contains a tweak to the letter "F", which I had always found to be difficult to parse visually.

What I Did

At the start of this project, I knew nothing about X11 fonts. So I had to find somewhere to start. I was determined to only use open-source software for this task. So I started by looking through what I had available on my FreeBSD box in the ports tree.

The nexus font was in .pcf format. I found a font editor in the ports tree, xfed. It worked with .bdf fonts, but not .pcf fonts. Fortunately I also found pcf2bdf in the ports tree.

    pcf2bdf -o nexus.bdf nexus.pcf

Then I tried to open the .bdf in in xfed, but was getting errors:

    parse error in line 6: syntax error

So I looked in the file I found it was plain text (hooray!), and found some lines that were empty, the first of which was line 5. When I looked in a few other bdf files, I saw no such lines. So I opened up the font in emacs and removed the blank line at line 5, and the got an error for the line before the next blank line. So I just removed all the blank lines, and then I was able to open the font in xfed.

I also took the liberty of editing the F character, which has always been a minor source of annoyance for me. I named my new version of the font wunexus.bdf

One other thing I did was corrected the name of the font by directly editing the .bdf so that it was properly named, which I'm hoping will increase it's ability to play along with some other tools.

    FONT -Misc-Wunexus-Medium-R-Normal--10-100-75-75-C-50-ISO8859-15

And I also changed:

    FAMILY_NAME "Wunexus"

I then copied the font into my font directory on OsX. You can add an additional directory to your font path like so:

    xset fp+ ~/dots/resources/xfree86/X_fonts

and rehashed my font path to pick up the new font:

    xset fp rehash

After that, my font shows up properly in xlsfonts:

    xlsfonts -fn '*wunexus*'

And I was able to view my font with xfd:

    xfd -fn '*wunexus*'

Success!!! I was also able to start emacs using the new font in my .Xdefaults file:

    Emacs*font: -Misc-Wunexus-Medium-R-Normal--10-100-75-75-C-50-ISO8859-15

which was exactly why I started this exercise!

My last step was to use fondu to convert the font to a mac friendly format, but I was never able to successfully convert the file. So I just used the fonts in X11 emacs and Eterm on os x... and then lots of time went by...

Then last week I installed 10.4, and a few more of my major annoyances about the OS X terminal have been fixed. But I spent hours looking through pixel font sites, and nothing compared to the readability and density of the nexus. So I had to find a way.

Finally after lots of playing around in fontforge, I was able to convert the file to a mac .dfont that worked great in OS X. The improvements in the font importing in 10.4 really helped me identify my problems. I had to recenter all the characters by hand, but it's now working great in the OS X terminal!

There are still some bugs, which can probably be attributed to my lack of font fu...





Updated Sat May 19, 2007 5:29 PM