help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Saving Fonts


From: Bingham, Jay
Subject: RE: Saving Fonts
Date: Wed, 16 Oct 2002 18:40:44 -0500

Peter,

You may think that you have solved this, but what you have is only a partial 
solution.
What you may not be aware of is that the function set-default-font is in 
actuality an alias for set-frame-font.  Which only sets the font for the 
current frame.  When it is run in your .emacs it only sets the font in the 
frame in which it is run, i.e. the initial frame.  If a new frame is created 
(C-x 5 2) it will have the default font.  If that does not bother you then you 
have a solution.  If it bothers you then you need to do something different.

Your options are: 
- Add the font specification to the default-frame-alist
- specify the font in an X resource

The method used to specify the font via the default-frame-alist is the same for 
both Windows and Unix emacen, put the following in your .emacs:
(add-to-list 'default-frame-alist '(font . 
"name-of-your-favorite-font-goes-here"))

The method used to specify the font via an X resource depends on the operating 
system that you run emacs under.  Since you are running in Windows specifying 
the X resource is done by adding an entry in the Windows Registry which is 
where an Emacs compiled for Windows looks for X resources.
One advantage of specifying the X resource is that the font is set before the 
initial frame is created.  For fonts this may not be noticeable (for frame 
geometry it is very noticeable).

To set the font via the Windows Registry, run regedit and under one of the 
following keys `HKEY_CURRENT_USER\SOFTWARE\GNU\Emacs' (affects you only, if 
each user of the machine has their own login) 
`HKEY_LOCAL_MACHINE\SOFTWARE\GNU\Emacs' (affects all users of the machine)
add a new string value (edit - new - string value) named 
Emacs.Font
Modify the value (edit - modify) and insert the font name string into the value 
data field, in your case it will probably be "-outline-Courier 
New-normal-r-normal-normal-12-90-96-96-c-70-iso8859-1" (the quotes are not 
included).  You could shorten this to "-outline-Courier 
New-normal-r-normal-normal-12-*-*-*-c-70-iso8859-1" if you were so inclined.

Another advantage of the X resource route is that the menu fonts (which are 
configurable only via the X resources) can be set to match the font that you 
have selected for the buffer window or to something else entirely if you 
prefer.  The following two X resources can be used to control menu fonts:
Emacs.pane.menubar.font (sets the menu bar)
Emacs.menu*.font (set the popup menus)

While I am yakking away here could I suggest that if you are not already 
subscribed you should checkout the emacs windows mailing list, which is the 
best place to ask windows specific questions (I am not implying that your 
question was windows specific, but my answer sure became so).  You can 
subscribe by sending a message to help-emacs-windows-request@gnu.org with the 
word "subscribe" in the body of the message.

Happy emacsing
-_
J_)
C_)ingham
.    HP - NonStop Austin Software & Services - Software Product Assurance
.    Office: 2166                Phone: 8945
. Language is the apparel in which your thoughts parade in public.
. Never clothe them in vulgar and shoddy attire.          -Dr. George W. Crane-

 -----Original Message-----
From:   Peter Ashford [mailto:me@here.there.com] 
Sent:   Tuesday, October 15, 2002 7:50 PM
To:     help-gnu-emacs@gnu.org
Subject:        Re: Saving Fonts


"Jesper Harder" <harder@myrealbox.com> wrote in message
news:m3elar2pw7.fsf@defun.localdomain...
> "Peter Ashford" <me@here.there.com> writes:
>
> > Thanks for that.  How do I find out the font string to use for the
> > font I like (Courier New, 9pt)?
>
> You can do `C-u c-x =' to discover the font string for the font you're
> currently using.
>

Thanks - that did the trick!

Peter.


_______________________________________________
Help-gnu-emacs mailing list
Help-gnu-emacs@gnu.org
http://mail.gnu.org/mailman/listinfo/help-gnu-emacs





reply via email to

[Prev in Thread] Current Thread [Next in Thread]