all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: amscott1@sedona.intel.com (Andrew M. Scott)
Subject: Help in querying xlsfonts for a particular font from elisp
Date: Fri, 25 Aug 2006 08:41:20 -0700	[thread overview]
Message-ID: <gfbk64wx1pb.fsf@chlr6708.ch.intel.com> (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

             reply	other threads:[~2006-08-25 15:41 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-25 15:41 Andrew M. Scott [this message]
2006-08-25 18:37 ` Help in querying xlsfonts for a particular font from elisp 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=gfbk64wx1pb.fsf@chlr6708.ch.intel.com \
    --to=amscott1@sedona.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.