unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Help-gnu-emacs@gnu.org
Subject: Re: How to set monospace font with .emacs shared between ubuntu and Cygwin
Date: Thu, 26 Sep 2024 09:02:17 +0300	[thread overview]
Message-ID: <86jzezar6e.fsf@gnu.org> (raw)
In-Reply-To: <DM3PR02MB102567DF5BD4D39C24834717E9D692@DM3PR02MB10256.namprd02.prod.outlook.com> (dk068x@att.com)

> From: "KARR, DAVID" <dk068x@att.com>
> Date: Wed, 25 Sep 2024 18:32:02 +0000
> 
> I have Cygwin emacs 29.4 running on my Windows laptop.  I have an Ubuntu VM running on that laptop, which is running Emacs 27.1.  I am trying to use the same .emacs file through a shared folder.  For most things, this works perfectly fine.  My Cygwin Emacs is using a proper monospace font, but the VM is using a proportional font.  I'd prefer that they both used the same font, but at a minimum, the Ubuntu VM needs to use a monospace font.
> 
> In my Cygwin Emacs, I ran "list-fonts" and got this:
> -----------------
> Fontset: -*-*-*-*-*-*-*-*-*-*-*-*-fontset-default
> Fontset: -*-courier new-normal-r-*-*-13-*-*-*-c-*-fontset-standard
> Fontset: -outline-Courier New-regular-normal-normal-mono-13-*-*-*-c-*-fontset-startup
> -----------------
> 
> In my Ubuntu VM Emacs, I did the same and got this:
> -------------
> Fontset: -DAMA-Ubuntu-normal-normal-normal-*-17-*-*-*-*-0-fontset-auto1
> Fontset: -DAMA-Ubuntu-normal-normal-normal-*-13-*-*-*-*-0-fontset-auto2
> Fontset: -*-*-*-*-*-*-*-*-*-*-*-*-fontset-default
> Fontset: -*-fixed-medium-r-normal-*-16-*-*-*-*-*-fontset-standard
> Fontset: -DAMA-Ubuntu Mono-normal-normal-normal-*-17-*-*-*-m-0-fontset-startup
> --------------
> 
> My .emacs currently has no customization related to fonts, except for "(global-font-lock-mode 1)" (I don't even remember what that does, and the associated descriptions are circular).
> 
> What are my options here?

My suggestion is to have your .emacs file specify the default font for
Ubuntu, using the system-type variable as the dispatch.  Find a font
on Ubuntu that you like, and then add to .emacs something like

  (unless (memq system-type '(cygwin windows-nt))
    (add-to-list 'default-frame-alist
      '(font . "YOUR-PREFERRED-FONT-HERE")))

To find out the correct specification of YOUR-PREFERRED-FONT-HERE,
start Emacs on Ubuntu, try different fonts (including sizes) until you
find one that you like, and then type "M-: (face-font 'default) RET".
This should produce the font string you can use in the above.

To try different fonts, you can use S-mouse-1, then select "Change
Buffer font" from the popup menu, which will display a font selection
dialog.  Alternatively, Options->"Set Default Font" from the menu bar
will show a similar font selection dialog.

HTH



      reply	other threads:[~2024-09-26  6:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-25 18:32 How to set monospace font with .emacs shared between ubuntu and Cygwin KARR, DAVID
2024-09-26  6:02 ` Eli Zaretskii [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86jzezar6e.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=Help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).