4

Right now the font in the menu bar is way too big, so I would like to add a line to my .emacs file that regulates that font size. I already have a line that takes care of the buffer font size, but it doesn't affect the menu.

Context: I am sshing into a unix machine from my Mac, and launching emacs from the terminal there.

  • 2
    You need to tell us about your context: platform, etc. There are different ways to tweak the menu-bar. For example see (elisp)X Resources. – Drew May 13 '15 at 22:45
1

This is Drew answer in details.

Configuring emacs menu is tricky but solvable. The problem is that emacs could be built with different visual libraries (like GTK, motif, lucid...) that affect on the menu apperanse different ways not related to emacs.

So what to do:

  1. Understand which visual library your emacs is build with. Menu Help > About emacs. In my case I see the line: GNU Emacs 27.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.18.9)

that means that my emacs is built with GTK-3 library. Library major version is important because for GTK-2 and GTK-3 configuration are different.

  1. Go to https://www.gnu.org/software/emacs/manual/html_node/emacs/X-Resources.html and look sublink for the resource of you library (in my case that was "GTK resources")

  2. Find the solution for your case (or google it additionally).

For my case of GTK-3 the following helped: I added:

#pane #menubar, 
#pane #menubar GtkMenuShell, 
#pane #menubar GtkMenuShell * 
{ 
    font-family: "URWPalladio"; 
    font-size: 18px; 
} 

to the file ~/.config/gtk-3.0/gtk.css and menu was bigger after emacs restart.

Useful links for the GTK-3

| improve this answer | |
  • Does this change the font size for ALL GTK3 applications, or just emacs? – Philip Jul 10 at 6:53
  • @Philip most probably for all ones – alex_1948511 Jul 11 at 5:40
1

For the benefit of other people possibly still looking the matter up and landing here: If your Emacs copy is built with Athena widgets (also known as Lucid) then you can use either command line arguments or X resources files.

In both cases you'd want to use emacs*menubar*font X resource and one of the fonts available to X windows system, as shown in the output of the xlsfonts utility.

If using command line arguments, add something like this to the invocation line:

--xrm="emacs*menubar*font:-xos4-terminus-medium-r-normal--22-220-72-72-c-110-iso10646-1"

If using X resources files (.Xresources or .Xdefaults, however your system is configured), add something like this to the X resources file and restart the X windows:

emacs*menubar*font:-xos4-terminus-medium-r-normal--22-220-72-72-c-110-iso10646-1

Also, if your Emacs copy is configured with --with-xft option, you may use Xft-style font definitions instead:

--xrm="emacs*menubar*font:Hack-10"

or

emacs*menubar*font:Hack-10

respectively.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.