[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Changing the default font on the fly
From: |
Eddie |
Subject: |
Re: Changing the default font on the fly |
Date: |
Sat, 23 Jun 2012 18:50:09 -0400 |
On Sat, 23 Jun 2012 14:25:00 -0700
"Drew Adams" <drew.adams@oracle.com> wrote:
> > I can use the menu and go Options | Set Default Font | nibble
> > through the various choices. But I'd rather not use the menu.
> > I would like to get a hunk of code that is the functional
> > equivalent to Options | Set Default Font | Droid Sans Regular 12.
> >
> > I don't know how to accomplish this on my own (I'm primarily a
> > writer and editor, and I've never demonstrated any talent for
> > programming), nor have I found any examples online that I could
> > modify for my own uses.
> >
> > And from there I would like to assign that hunk of code to a
> > keystroke series. I've assigned some macros to keystrokes, so I
> > think I can do that part.
> >
> > Any suggestions would be gratefully appreciated.
>
> http://emacswiki.org/emacs/SetFonts
>
Thanks, I did see that page. And I had learned ways to set, say,
(set-frame-font
"-unknown-Droid Sans
Mono-normal-normal-normal-*-*-*-*-*-m-0-iso10646-1")
as a default by sticking it in my .emacs. But as it turns out, I cannot
figure out how to assign those same 2 lines of text to a keystroke
combination, or to assign, say,
(set-frame-font
"-unknown-Carmina Md
BT-normal-normal-normal-*-*-*-*-*-*-0-iso10646-1")
to another keystroke combo. I don't know how to turn these lines of text
into either a command or a function or an elisp file or a macro or
something that I can assign to a keystroke, the way I did with this
line that turns typopunct mode on & off.
(global-set-key "\C-x\M-t" 'typopunct-mode)
I think one difference is that "set-frame-font" requires a response,
whereas "typopunct-mode" is either on or off.
Did I mention that I am no programmer? :)
I could go on utilizing the menu to change typefaces, but I'd rather
not if I can avoid it.