Tag | xwindows

Adding your custom fonts to Cygwin’s XWin

Sep 29th, 2009No Comments

I decided to finally make the leap and install Cygwin’s XWindows and run Emacs out of that instead of NTEmacs.  There wasn’t one big thing, but a bunch of little things, including:

  • I wanted to stop using Plink in TRAMP, because that was a mess.  I know that it works better with a command line SSH client, like what I was using for Cygwin.
  • They took my Win32 grep away!  How else am I going to use grep-mode?
  • Pasting a path/filename from my Cygwin prompt to NTEmacs always involved an extra step — calling cygpath and the copying the value.
  • I wanted to mess around with BicycleRepairMan but my Python environment is in Cygwin and my Emacs environment wasn’t.

If you read between the lines, you see a common theme — control.  In my entire Windows workstation, I have very little control over the environment.  In my little Cygwin world,  I have almost complete control.

I had installed and used Emacs within Cygwin/X before, but found that it was slow and clusmey.  Now they’ve had a few years to work out the kinks and I have a much more powerful workstation. And so I tried it again. Yep, things are much better!  However, I like some of the functionality of Emacs 22 but Cygwin doesn’t have Emacs 22 — they still have Emacs 21 as “stable” and Emacs 23 as experimental!  So I jumped through the hoops to install the “unstable” Emacs 23 along with X-windows (XWin, the Cygwin/X world.)

And thus our story begins.  Since I now have complete control on one part of my GUI and one of the things I’m picky about is fonts.  I like to use ProggyClean and, now, heck I can install it. So I downloaded it, move it to the right file, did the magic “xset fp rehash” and  . . . nothing.  Nadda.  XWin couldn’t find it.

I won’t depress you with a play-by-play, but this is an overview:

  • I made ~/.fonts a font directory
  • fonconfig ignores any addition to the /etc/fonts/local.conf file even though it says I loaded it.
  • I decided to kick up old school and edit the ~/.xinitrc file — only to find out that if XWin starts in Rootless most it doesn’t even look at the ~/.xinitirc.

What ended up working was that I added the following to the /usr/bin/startxwin.bat file just before the last command (an xterm, I believe):


%RUN% /usr/bin/xset +fp /cygdrive/h/.fonts &

Then the font is loaded! Then I just make sure my ~/.emacs says:

(set-default-font  
"-windows-proggyclean-medium-r-normal--13-80-96-96-c-70-iso8859-1"
)

And then you see such beautiful things as:

Emacs using Proggy Clean

Emacs using Proggy Clean