all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Saving Fonts
@ 2002-10-15 21:41 Peter Ashford
  2002-10-15 23:04 ` Wu XiaoGuang
  0 siblings, 1 reply; 6+ messages in thread
From: Peter Ashford @ 2002-10-15 21:41 UTC (permalink / raw)


Hi There,

I'm using the Emacs 21.2.1 on WindowsXP.  I can set the font to one I like
easily enough, but is there some elisp snippet I could put in my .emacs file
to make emacs always start up in my preferred font?

Thanks in advance,

Peter.

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

* Re: Saving Fonts
  2002-10-15 21:41 Saving Fonts Peter Ashford
@ 2002-10-15 23:04 ` Wu XiaoGuang
  2002-10-16  0:10   ` Peter Ashford
  0 siblings, 1 reply; 6+ messages in thread
From: Wu XiaoGuang @ 2002-10-15 23:04 UTC (permalink / raw)



On Wed, 16 Oct 2002 10:41:44 +1300, Peter Ashford wrote:

> Hi There, I'm using the Emacs 21.2.1 on WindowsXP.  I can set the
> font to one I like easily enough, but is there some elisp snippet I
> could put in my .emacs file to make emacs always start up in my
> preferred font?

> Thanks in advance,

> Peter.

Here is my setting in ~/.emacs:

;;; Set default font
(set-default-font "-b&h-lucidatypewriter-medium-*-*-*-16-*-*-*-*-*-*-*")

__________________________________________________
Do You Yahoo!?
Sign up for SBC Yahoo! Dial - First Month Free
http://sbc.yahoo.com

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

* Re: Saving Fonts
  2002-10-15 23:04 ` Wu XiaoGuang
@ 2002-10-16  0:10   ` Peter Ashford
  2002-10-16  0:23     ` Jesper Harder
  0 siblings, 1 reply; 6+ messages in thread
From: Peter Ashford @ 2002-10-16  0:10 UTC (permalink / raw)



"Wu XiaoGuang" <xgwu@linux.net.cn> wrote in message
news:87hefncnif.fsf@linux.net.cn...
>
> On Wed, 16 Oct 2002 10:41:44 +1300, Peter Ashford wrote:
>
> > Hi There, I'm using the Emacs 21.2.1 on WindowsXP.  I can set the
> > font to one I like easily enough, but is there some elisp snippet I
> > could put in my .emacs file to make emacs always start up in my
> > preferred font?
>
> > Thanks in advance,
>
> > Peter.
>
> Here is my setting in ~/.emacs:
>
> ;;; Set default font
> (set-default-font "-b&h-lucidatypewriter-medium-*-*-*-16-*-*-*-*-*-*-*")
>

Thanks for that.  How do I find out the font string to use for the font I
like (Courier New, 9pt)?

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

* Re: Saving Fonts
  2002-10-16  0:10   ` Peter Ashford
@ 2002-10-16  0:23     ` Jesper Harder
  2002-10-16  0:49       ` Peter Ashford
  0 siblings, 1 reply; 6+ messages in thread
From: Jesper Harder @ 2002-10-16  0:23 UTC (permalink / raw)


"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.

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

* Re: Saving Fonts
  2002-10-16  0:23     ` Jesper Harder
@ 2002-10-16  0:49       ` Peter Ashford
  0 siblings, 0 replies; 6+ messages in thread
From: Peter Ashford @ 2002-10-16  0:49 UTC (permalink / raw)



"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.

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

* RE: Saving Fonts
@ 2002-10-16 23:40 Bingham, Jay
  0 siblings, 0 replies; 6+ messages in thread
From: Bingham, Jay @ 2002-10-16 23:40 UTC (permalink / raw)


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

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

end of thread, other threads:[~2002-10-16 23:40 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-10-15 21:41 Saving Fonts Peter Ashford
2002-10-15 23:04 ` Wu XiaoGuang
2002-10-16  0:10   ` Peter Ashford
2002-10-16  0:23     ` Jesper Harder
2002-10-16  0:49       ` Peter Ashford
  -- strict thread matches above, loose matches on Subject: below --
2002-10-16 23:40 Bingham, Jay

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.