I really like the "vera sans mono" font, but it's only available on
some of the platforms I use.
My .emacs currently uses the elisp fragment below, with a simple (getenv
"PLATFORM")
kludge in the <need-some-help-here> test section; however this fails if I ssh
from
a supported platform's xterm onto an unsupported platform.
I'd like help with cleaner solution to test for a supported platform
font.
(when (<need-some-help-here>)
(set-face-font 'default "-bitstream-bitstream vera sans
mono-medium-r-*-*-16-120-*-*-*-*-*-1")
;; AMS: Not clear why I need these next two lines
(add-to-list 'default-frame-alist '(font . "-bitstream-bitstream vera sans
mono-medium-r-*-*-16-120-*-*-*-*-*-1"))
(add-to-list 'initial-frame-alist '(font . "-bitstream-bitstream vera sans
mono-medium-r-*-*-16-120-*-*-*-*-*-1"))
(set-frame-position (selected-frame) -8 -100)
)
The X11 xlsfonts command seems promising, e.g.
xlsfonts -fn "-bitstream-bitstream vera sans
mono-medium-r-*-*-16-120-*-*-*-*-*-1" | wc -l
returns
2
on a supported platform, and the two lines
xlsfonts: pattern "-bitstream-bitstream vera sans
mono-medium-r-*-*-16-120-*-*-*-*-*-1" unmatched
0
I've played with variations of shell-command e.g.
(when (shell-command "xlsfonts -fn '-bitstream-bitstream vera sans
mono-medium-r-*-*-16-120-*-*-*-*-*-1' | wc -l" t)
(message "font exists")
(message "font doesn't exist"))