* Default font / size
@ 2017-06-20 21:50 John Mastro
2017-06-20 22:03 ` John Mastro
` (3 more replies)
0 siblings, 4 replies; 8+ messages in thread
From: John Mastro @ 2017-06-20 21:50 UTC (permalink / raw)
To: help-gnu-emacs@gnu.org
The default font in "emacs -Q" in "Courier New-10.0". I'd like to change
that to "Consolas-10.0" via Lisp code, but without explicitly specifying
the font size of "10.0"[1].
Is there any way to do that? My first thought was to try
(add-to-list 'default-frame-alist '(font . "Consolas"))
but that results in "Consolas-12".
[1]: My goal is to avoid having to specify a different font size for
each of the systems on which I use Emacs, since Emacs presumably
has logic to pick a reasonable font size.
Thanks
John
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Default font / size
2017-06-20 21:50 Default font / size John Mastro
@ 2017-06-20 22:03 ` John Mastro
2017-06-20 23:30 ` Mekeor Melire
` (2 subsequent siblings)
3 siblings, 0 replies; 8+ messages in thread
From: John Mastro @ 2017-06-20 22:03 UTC (permalink / raw)
To: help-gnu-emacs@gnu.org
John Mastro <john.b.mastro@gmail.com> wrote:
> The default font in "emacs -Q" in "Courier New-10.0". I'd like to change
^^
is
(And the specific fonts I referred to are just examples from the machine
I happen to be at)
John
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Default font / size
2017-06-20 21:50 Default font / size John Mastro
2017-06-20 22:03 ` John Mastro
@ 2017-06-20 23:30 ` Mekeor Melire
2017-06-21 9:31 ` Emanuel Berg
2017-06-21 17:47 ` Eli Zaretskii
3 siblings, 0 replies; 8+ messages in thread
From: Mekeor Melire @ 2017-06-20 23:30 UTC (permalink / raw)
To: John Mastro; +Cc: help-gnu-emacs@gnu.org
[-- Attachment #1: Type: text/plain, Size: 1055 bytes --]
John Mastro <john.b.mastro@gmail.com> writes:
> The default font in "emacs -Q" in "Courier New-10.0". I'd like to change
> that to "Consolas-10.0" via Lisp code, but without explicitly specifying
> the font size of "10.0"[1].
>
> Is there any way to do that? My first thought was to try
>
> (add-to-list 'default-frame-alist '(font . "Consolas"))
>
> but that results in "Consolas-12".
>
> [1]: My goal is to avoid having to specify a different font size for
> each of the systems on which I use Emacs, since Emacs presumably
> has logic to pick a reasonable font size.
Personally, I do exactly that: For each host, I specify my favorite
font-size. If you want to have a look at the relevant part of my
init.el, take a look at the inline-attachment at the end of this mail or
at this link (to a proprietary web-service):
https://github.com/mekeor/config/blob/master/home/mekeor/.emacs.d/init.el#L1-L28
Sorry for not being helpful by not answering your question. I'd also
like to know if there is a solution like what you're hoping for.
[-- Attachment #2: init.snip.el --]
[-- Type: application/emacs-lisp, Size: 1254 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Default font / size
2017-06-20 21:50 Default font / size John Mastro
2017-06-20 22:03 ` John Mastro
2017-06-20 23:30 ` Mekeor Melire
@ 2017-06-21 9:31 ` Emanuel Berg
2017-06-21 17:47 ` Eli Zaretskii
3 siblings, 0 replies; 8+ messages in thread
From: Emanuel Berg @ 2017-06-21 9:31 UTC (permalink / raw)
To: help-gnu-emacs
John Mastro <john.b.mastro@gmail.com> writes:
> [1]: My goal is to avoid having to specify
> a different font size for each of the systems on
> which I use Emacs, since Emacs presumably has logic
> to pick a reasonable font size.
Apparently not!
If you want to achieve different fonts on different
machines, but without having different Elisp on
different machines, I suppose one way to do that would
be to rely on environmental vars, as in
(getenv "EDITOR") ; "/usr/bin/emacs"
Set up one such to hold the font. Of course, this only
means that instead of changing Elisp on each system,
you would have to set the font variable on
each system.
--
underground experts united
http://user.it.uu.se/~embe8573
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Default font / size
2017-06-20 21:50 Default font / size John Mastro
` (2 preceding siblings ...)
2017-06-21 9:31 ` Emanuel Berg
@ 2017-06-21 17:47 ` Eli Zaretskii
2017-06-21 19:15 ` John Mastro
3 siblings, 1 reply; 8+ messages in thread
From: Eli Zaretskii @ 2017-06-21 17:47 UTC (permalink / raw)
To: help-gnu-emacs
> From: John Mastro <john.b.mastro@gmail.com>
> Date: Tue, 20 Jun 2017 14:50:50 -0700
>
> The default font in "emacs -Q" in "Courier New-10.0". I'd like to change
> that to "Consolas-10.0" via Lisp code, but without explicitly specifying
> the font size of "10.0"[1].
>
> Is there any way to do that? My first thought was to try
>
> (add-to-list 'default-frame-alist '(font . "Consolas"))
>
> but that results in "Consolas-12".
>
> [1]: My goal is to avoid having to specify a different font size for
> each of the systems on which I use Emacs, since Emacs presumably
> has logic to pick a reasonable font size.
I admit I'm confused about your goals: on the one hand you don't want
to specify the font size, and OTOH you don't like the size Emacs
chooses without your specifying it, is that right? Or did I miss
something?
If indeed I understood what you wanted, then what alternative
mechanisms for choosing font size did you have in mind which could
fulfill your goals?
Or maybe you are asking why Emacs chooses size 12 for Consolas, but
size 10 for Courier New, and what factors affect that?
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Default font / size
2017-06-21 17:47 ` Eli Zaretskii
@ 2017-06-21 19:15 ` John Mastro
2017-06-21 19:30 ` Eli Zaretskii
0 siblings, 1 reply; 8+ messages in thread
From: John Mastro @ 2017-06-21 19:15 UTC (permalink / raw)
To: help-gnu-emacs@gnu.org
Eli Zaretskii <eliz@gnu.org> wrote:
> I admit I'm confused about your goals: on the one hand you don't want
> to specify the font size, and OTOH you don't like the size Emacs
> chooses without your specifying it, is that right? Or did I miss
> something?
>
> If indeed I understood what you wanted, then what alternative
> mechanisms for choosing font size did you have in mind which could
> fulfill your goals?
>
> Or maybe you are asking why Emacs chooses size 12 for Consolas, but
> size 10 for Courier New, and what factors affect that?
Indeed, that may be a better way of putting it.
The way I was thinking of it, probably muddled, was: Emacs has some way
of selecting 10 as the font size when I don't specify a font, so I just
need to find a way to ask it to do that when I specify Consolas.
But if 12 is selected for Consolas because of some difference(s) between
Courier New and Consolas then I probably can't avoid specifying the
size (without avoiding Consolas anyway).
Thanks
John
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Default font / size
2017-06-21 19:15 ` John Mastro
@ 2017-06-21 19:30 ` Eli Zaretskii
2017-06-21 20:29 ` John Mastro
0 siblings, 1 reply; 8+ messages in thread
From: Eli Zaretskii @ 2017-06-21 19:30 UTC (permalink / raw)
To: help-gnu-emacs
> From: John Mastro <john.b.mastro@gmail.com>
> Date: Wed, 21 Jun 2017 12:15:03 -0700
> Cc: Eli Zaretskii <eliz@gnu.org>
>
> > Or maybe you are asking why Emacs chooses size 12 for Consolas, but
> > size 10 for Courier New, and what factors affect that?
>
> Indeed, that may be a better way of putting it.
>
> The way I was thinking of it, probably muddled, was: Emacs has some way
> of selecting 10 as the font size when I don't specify a font, so I just
> need to find a way to ask it to do that when I specify Consolas.
>
> But if 12 is selected for Consolas because of some difference(s) between
> Courier New and Consolas then I probably can't avoid specifying the
> size (without avoiding Consolas anyway).
I think (but don't have time to check this now) that size 10 for
Courier New is due to how the default fontset is set up on Windows,
see w32-win.el. If I'm right, then perhaps you could tweak
w32-standard-fontset-spec in your init file such that other fonts are
also chosen with size 10. (Tweaking that variable needs to be done
from one of the hooks defined by startup.el, I think.)
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Default font / size
2017-06-21 19:30 ` Eli Zaretskii
@ 2017-06-21 20:29 ` John Mastro
0 siblings, 0 replies; 8+ messages in thread
From: John Mastro @ 2017-06-21 20:29 UTC (permalink / raw)
To: help-gnu-emacs@gnu.org
Eli Zaretskii <eliz@gnu.org> wrote:
> I think (but don't have time to check this now) that size 10 for
> Courier New is due to how the default fontset is set up on Windows,
> see w32-win.el. If I'm right, then perhaps you could tweak
> w32-standard-fontset-spec in your init file such that other fonts are
> also chosen with size 10. (Tweaking that variable needs to be done
> from one of the hooks defined by startup.el, I think.)
Yep, looks like it's specified by `w32-standard-fontset-spec', so I've
been barking up the wrong tree.
Thanks for the help. I've avoided learning about fontspecs but it seems
I'll need to take the plunge if I want to pursue this further :)
John
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2017-06-21 20:29 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-20 21:50 Default font / size John Mastro
2017-06-20 22:03 ` John Mastro
2017-06-20 23:30 ` Mekeor Melire
2017-06-21 9:31 ` Emanuel Berg
2017-06-21 17:47 ` Eli Zaretskii
2017-06-21 19:15 ` John Mastro
2017-06-21 19:30 ` Eli Zaretskii
2017-06-21 20:29 ` John Mastro
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).