From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Edward O'Connor Newsgroups: gmane.emacs.help Subject: Re: list available fonts/fontsets Date: Tue, 21 Jun 2005 11:00:58 -0700 Organization: Church of Emacs Message-ID: References: <959DF48BD1458D4C8DBFDAC8DF80D7F7026639A6@europa.ats.sensis.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1119376805 2759 80.91.229.2 (21 Jun 2005 18:00:05 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 21 Jun 2005 18:00:05 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Jun 21 19:59:58 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Dkn1e-000834-UU for geh-help-gnu-emacs@m.gmane.org; Tue, 21 Jun 2005 19:59:07 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Dkn87-0006PG-Tl for geh-help-gnu-emacs@m.gmane.org; Tue, 21 Jun 2005 14:05:47 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Dkn7r-0006O9-3d for help-gnu-emacs@gnu.org; Tue, 21 Jun 2005 14:05:31 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Dkn7p-0006NH-Do for help-gnu-emacs@gnu.org; Tue, 21 Jun 2005 14:05:30 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Dkn7o-0006Mb-T8 for help-gnu-emacs@gnu.org; Tue, 21 Jun 2005 14:05:28 -0400 Original-Received: from [80.91.229.2] (helo=ciao.gmane.org) by monty-python.gnu.org with esmtp (TLS-1.0:RSA_AES_128_CBC_SHA:16) (Exim 4.34) id 1Dkn9W-00051j-VS for help-gnu-emacs@gnu.org; Tue, 21 Jun 2005 14:07:15 -0400 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1Dkmz8-0007Kc-W1 for help-gnu-emacs@gnu.org; Tue, 21 Jun 2005 19:56:31 +0200 Original-Received: from rrcs-67-52-157-90.west.biz.rr.com ([67.52.157.90]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 21 Jun 2005 19:56:30 +0200 Original-Received: from hober0 by rrcs-67-52-157-90.west.biz.rr.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 21 Jun 2005 19:56:30 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-To: help-gnu-emacs@gnu.org Original-Lines: 43 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: rrcs-67-52-157-90.west.biz.rr.com Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAHlBMVEX47PoBAAegiLwiH1N IQYI0M4iMeKYBAAYGBBGqm9JF4g0mAAACYElEQVR4nGWTsY/aMBTGLXoLo8WQjNVrFJXxzviUbig JEcy5SNft5LhRGT3RNecUuRuiCMn/bZ+dhHDqJ2SZ7+f3nt/DEMOcqv9E9AdQTsD7fPw6hRIz+iw xxuhbMBn3SUtRofk95CTa9D49UIWiRvt4TnTiNmUbHIIDykUxdwm8lTvQUmergwoCpXR/qwojXqk 7jTEK1xANXhKOgD8eRmHggrt2CNKKtfcAU3EHkCbB5OJn4Ws40Prco6jhAyiDoSyeTrAb1gNe+dI eKNVlpvXNE5+pT6HUIjEi24a8B6XvjSrd0rCon5vCDwX7eA2wvV9bqrPWdCAFZBtfA0tQRWmRsE6 uZCMA6qYHbRDg6I5RlxVSFNCISG56QB3oIBNSRKL+JuLMg9LZlGqIUhCFlH9m8FN74GxFQwEFxKm crWYQJQ680v43TSEGEDArAWLJPVAObN8BHDghhrwcI1RYH2GSLMfiKnzWd6DGx4DvwNc41mIC0QQ WqzgXH0HV+kvVoohvIB5AaHRSyCZHyzawtOd4SBUyXR9lxOb2RB7Sz4T0AB8zY/smvWzRIrN0OQL GcsbW8zf7dY1gfsIlZm66JUsdOK3ljjjNCbnoHuxq9jQnb+TkAa6XY0XyJmf7C1uRwfbk4b0m1tr 8+zljb+ROD0+xA9f4umHP9+CTAAesjfGPWNyBvzCAc5ax/I40CFJPvkQrC/vRP+NsiC58LpGKfWH 7Ppy/JMY8ObK0AJfTRUDTz5eQxHS2VxPlG1697N0ee4qSbjeQ64bjc94Nhex1b+2N5Hn1MoJJwlp pf1Rr7/8DXitGHanPc2gAAAAASUVORK5CYII= X-Attribution: Ted User-Agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (darwin) Cancel-Lock: sha1:Jql+mJ9sD58djAacDPnN07J0fjs= X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:27574 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:27574 > I'm trying to make my .emacs work on MS Windows and X on Solaris, Excellent. > but on X when I setup my initial-frame-alist, and default-frame-alist, > it chokes on an invalid font, namely, > -outline-Courier New-normal-r-normal-normal-12-90-96-96-c-*-iso10646-1. > Is there a method which will display all that's available? M-x > list-fontsets didn't seem to be what I needed. Well, here's something resembling what I do to make fonts happy under different system types. (require 'cl) (set-frame-parameter nil 'font (or (find-if (lambda (font) (ignore-errors (x-list-fonts font))) '("-*-andale mono-medium-r-*--14-*-*-*-*-*-*-*" "-*-bitstream vera sans mono-medium-r-*-*-14-*-*-*-*-*-iso8859-*" "-*-Lucida Console-normal-r-*-*-18-*-*-*-c-*-iso8859-1")) "-adobe-courier-medium-r-*-*-14-*-*-*-*-*-*-*")) The explanation: we want to set Emacs' font to one we like, but not all machines have the same fonts available. First, we look for Andale Mono 14 (a common font on Mac OS X). If such a font is available (`x-list-fonts' returns non-null), we use it. Otherwise, we try Bitstream Vera Sans Mono 14 (common under X11). If we can't find that, we'll try Lucida Console 18 (common under Windows). If all of the above have failed, we'll use Courier 14 (common everywhere, so good as a default). Disclaimer: the actual code in my .emacs file is a bit more complicated than the above, and I haven't tested what appears above. But it should convey the idea I think. Ted -- Edward O'Connor hober0@gmail.com Ense petit placidam sub libertate quietem.