5

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.

Sarah
  • 51
  • 1
  • 3
  • 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`](http://www.gnu.org/software/emacs/manual/html_node/emacs/X-Resources.html). – Drew May 13 '15 at 22:45

3 Answers3

3

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

alex_1948511
  • 129
  • 4
2

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.

yury10578
  • 121
  • 3
0

The following is what worked for me, with emacs with GTK+ Version 2: Put the following lines in ~/.emacs.d/gtkrc file:

# Define the style ‘my_style’.
style "my_style"
{
  font_name = "helvetica bold 14"
}
# Specify that widget type ‘*emacs-menuitem*’ uses ‘my_style’.
widget "*emacs-menuitem*" style "my_style"
Yoram
  • 1
  • 1