From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: floyd@barrow.com (Floyd L. Davidson) Newsgroups: gmane.emacs.help Subject: Re: How can I determine what the default font it? Date: Thu, 26 Feb 2004 02:25:20 -0900 Organization: __________ Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <87ptc2w09r.fld@barrow.com> References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1077795445 13612 80.91.224.253 (26 Feb 2004 11:37:25 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 26 Feb 2004 11:37:25 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Feb 26 12:37:17 2004 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AwJpM-0000KM-00 for ; Thu, 26 Feb 2004 12:37:16 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.30) id 1AwJmH-0004Vx-Us for geh-help-gnu-emacs@m.gmane.org; Thu, 26 Feb 2004 06:34:05 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!headwall.stanford.edu!newshub.sdsu.edu!cyclone.bc.net!HSNX.atgi.net!falcon.america.net!eagle.america.net.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: gnus 5.10.6/XEmacs 21.4.15/Linux 2.6.0 Cancel-Lock: sha1:vz5esSqC1f6NVaM0zRGm7obY3Fs= Original-Lines: 172 Original-NNTP-Posting-Host: 209.124.156.105 Original-X-Trace: eagle.america.net 1077794770 209.124.156.105 (Thu, 26 Feb 2004 06:26:10 EST) Original-NNTP-Posting-Date: Thu, 26 Feb 2004 06:26:10 EST Original-Xref: shelby.stanford.edu gnu.emacs.help:121275 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:17229 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:17229 exits funnel wrote: >Hello, > >I've just upgraded to emacs 21.3.1 from emacs 19.7(?) >running on RedHat Linux. It works great but for one >immediate problem. The default font size is much >smaller and I can barely read it. I've done a bit of >research (I'm pretty new to Linux and well as emacs) >on changing the font size but I have a few quick >questions. First of all it seems I can do this either >by modifying my .emacs file or by modifying >.Xdefaults. Which approach is better? You'll want to note that basically all of this applies not only to Emacs, but to xterms as well, where you will probably have exactly the same problem. (I use a 1333x1000 resolution screen, and have fits trying to work out fonts that provide readable text in windows of the right size.) Probably .Xdefaults is best, because that relates closely to the X configuration (which is where the screen resolution is chosen). You can use the same ~/.emacs file, regardless of the X configuration if you specify font sizes with the X configuration rather than the Emacs configuration. There still seem to be lots of "gotchas", and I haven't worked it out well enough for GNU Emacs (mostly because I normally use XEmacs, and they don't work quite the same). In particular, it is necessary to go through the faces customization menu and set fonts. And I've found that some fonts simply can't be manipulated by GNU Emacs (for reasons that I do not at all understand). For example, I rather like, in XEmacs, using the -misc-fixed-medium-r-semicondensed fonts. But GNU Emacs can't scale them, and attempts to do so result in very small sizes. One comment on testing changes to ~/.Xdefaults before going on to the rest of this. To test a new configuration you can use xrdb to effect the new configuration, but there are two ways to do it. xrdb -merge .Xdefaults is usually recommended, but it will not delete something you have removed from .Xdefaults. It will add, and it will change, but no deletions. But, xrdb .Xdefaults will replace the existing definitions with the new definitions, which means something that is not defined in the new file will not exist after that command. Hence it will delete what you've removed, but it also deletes everything from any other initialization files. I.e., it's good for testing, but you'll want to restart X when you are done. >I'm assuming >if I change .Xdefaults this will affect other programs >besides emacs. Only if you want it to. For example, *font: -*-courier-*-*-*-*-23-*-*-*-*-*-iso8859-1 will affect virtually everything ending in "font" that is not otherwise specifically set, and hence is probably not a good idea. There are two ways to be specific, Emacs*font: -*-courier-*-*-*-*-23-*-*-*-*-*-iso8859-1 Emacs.font: -*-courier-*-*-*-*-23-*-*-*-*-*-iso8859-1 will both affect either Emacs or XEmacs, but nothing else. While XEmacs*font: -*-courier-*-*-*-*-23-*-*-*-*-*-iso8859-1 XEmacs.font: -*-courier-*-*-*-*-23-*-*-*-*-*-iso8859-1 will both affect only XEmacs and not GNU Emacs. The difference between using the '*' wildcard or not, is that the wild card will set all Emacs resources that end in "font", that are not more specifically defined, while using the "." specifies one and only one resource. Hence, if you have only Emacs.font: -*-courier-*-*-*-*-23-*-*-*-*-*-iso8859-1 you might have not set several fonts, and they will default to something like "fixed", which is exceedingly small and moreover Emacs can neither scale it or find variations for such as bold, italic, or underline. But if you set Emacs*font: 9x15 you're screwed too, because everything is set to a font that Emacs cannot manipulate. However, I don't know that Emacs has any resource ending in "font" other than the default, so it (may or) may not make any difference at all. But definitely with other programs that is significant... (for colors and other resources as well as fonts). >My other question is how can I find >out what font emacs is currently displaying? Thanks >in advance for any replies. You can do "M-x list-faces-display" which will give you a line of text for each face that is defined. It gives you the variable for that particular face, and you can select from that buffer any of the face names and change the font or other properties. For example, with some fonts being too small (once you have the basic defaults set in .Xdefaults), you can browse the list and change the ones that are hard to read. There are some strange things happen with fonts in GNU Emacs that you may or may not bothered by. One is the way tabs are offset. I have the following in my .Xdefaults file, and used it for checking the results of font changes. # # When playing with fonts for GNU Emacs, the tabs do not # necessarily line up where they should when fonts are scaled. # The following chart uses tabs between the 'T' characters, and # spaces between the '|' characters. They should line up # exactly... # # T T T T T T T T T T #1234567890123456789012345678901234567890123456789012345678901234567890123456789 # | | | | | | | | | | Note the comment about tabs between the "T" characters on the chart. If, between my writing this and you reading it, they get changed to spaces, it won't provide the needed value... A couple recommendations. Change the size to suit your needs, but for menus and pop-ups the proportional spacing with a helvetica font is much nicer. I use bold to make it more readable too. YMMV, of course. # # Font menus # Emacs*menubar*font: -*-helvetica-bold-r-*-*-16-*-*-*-*-*-iso8859-* Emacs*popup*font: -*-helvetica-bold-r-*-*-16-*-*-*-*-*-iso8859-* Here is what I like for the default font. Unfortunately, GNU Emacs (unlike XEmacs) can't seem to scale this font. Emacs.font: -misc-fixed-medium-r-semicondensed-*-25-*-100-*-*-*-iso8859-1 Here is what I set for attribute fonts. Emacs.default.attributeFont: -*-courier-*-*-*-*-23-*-*-*-*-*-iso8859-1 Emacs.bold.attributeFont: -*-courier-bold-r-*-*-23-*-*-*-*-*-iso8859-1 Emacs.italic.attributeFont: -*-courier-medium-r-*-*-23-*-*-*-*-*-iso8859-1 Emacs.bold-italic.attributeFont: -*-courier-bold-r-*-*-23-*-*-*-*-*-iso8859-1 (Note that I don't use the oblique font for italics, because it is just too ugly to look at and hard to read.) However, despite having set those in ~/.Xdefaults, I'm pretty sure that I've changed every one of them using the customize menu, and therefore that is overridden by custom-set-faces written to ~/.emacs.el. The problem is that while the courier fonts do scale, it is at intervals and is not a continuous allowable range, and the trick is to get a size to most closely match the default font's size. -- Floyd L. Davidson Ukpeagvik (Barrow, Alaska) floyd@barrow.com