all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Help in querying xlsfonts for a particular font from elisp
@ 2006-08-25 15:41 Andrew M. Scott
  2006-08-25 18:37 ` Peter Dyballa
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Andrew M. Scott @ 2006-08-25 15:41 UTC (permalink / raw)


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"))
but the shell calling subtleties escape me. Is there a non-interactive
version of shell-command?

Thanks,
Andy Scott

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2006-08-28 17:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-25 15:41 Help in querying xlsfonts for a particular font from elisp Andrew M. Scott
2006-08-25 18:37 ` Peter Dyballa
2006-08-28 16:09   ` Andrew M. Scott
2006-08-28 15:16 ` Kevin Rodgers
     [not found] ` <mailman.5816.1156778244.9609.help-gnu-emacs@gnu.org>
2006-08-28 17:24   ` Andrew M. Scott

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.