135

XTerm font is very small. How can I set it larger?

Eliah Kagan
  • 116,445
  • 54
  • 318
  • 493
Sudo
  • 1,353
  • 2
  • 9
  • 4
  • this also would be helpful - avoid bold chars on it http://unix.stackexchange.com/questions/31999/how-to-make-xterm-never-use-bold-characters – Sergio Abreu Jan 15 '17 at 19:10
  • This is exhaustive, and gives a bit of insight to the xterm program: http://invisible-island.net/xterm/manpage/xterm.html – SDsolar Aug 01 '17 at 18:05

8 Answers8

127

If you don't already have one, create a file in your home directory named .Xresources to store your preferences for various X programs. Append a line to the file such as

xterm*font:     *-fixed-*-*-*-18-*

This informs xterm to use the 'fixed' font at size 18. From here, to incorporate the changes you've made you can either:

  • restart X; or
  • run xrdb -merge ~/.Xresources in a terminal

All new xterms should now have the font change.

If you run man xterm and go down to the RESOURCES section, you can find a wealth of additional, configurable xterm options.

noffle
  • 1,595
  • 1
  • 10
  • 6
  • Thanks noffle it worked....but how can i set the dimensions of the xterm windows to a fixed ones? – Sudo Jul 10 '12 at 09:32
  • 3
    The X resource for dimensions is `geometry`. So something like the following in your `.Xresources` would work: `xterm*geometry: 110x50`. – noffle Jul 10 '12 at 14:07
  • 6
    You're welcome. Consider creating a separate question in the future for the geometry issue rather than tacking it into a comment: it makes it harder for others to find. – noffle Jul 10 '12 at 17:06
  • Thanks for mentioning 'xrdb -merge' part, that did the trick! – HidekiAI May 10 '16 at 12:16
  • Have this same question, both font-size and resize issue, thanks @noffle – Onix Feb 25 '17 at 20:37
  • 5
    `xterm: cannot load font '*-fixed-*-*-*-38-*'` `Warning: Shell widget "xterm" has an invalid geometry specification: "*-fixed-*-*-*-38-*"` – Aaron Franke Apr 20 '18 at 17:53
87

Use -fa and -fs parameters:

xterm -fa 'Monospace' -fs 14
nvd
  • 1,130
  • 9
  • 7
  • 4
    This does not "change the default font size" (as requested)! – Dirk Aug 23 '16 at 15:58
  • That works at the command line but not from the GUI. – SDsolar Aug 01 '17 at 17:52
  • Using `Monospace` will not just change the size but use a quite different font (at least that's the case on Ubuntu 18.04). And I find `Monospace` to be using excessive amounts of anti-aliasing which makes it looks blurry when viewed next to an `xterm` window using the default font. – kasperd Jan 09 '19 at 10:34
  • 3
    To list monospaced `xterm` fonts: `fc-list | cut -f2 -d: | sort -u | grep -i Mono`. If you prefer sans fonts, try `DejaVu Sans Mono`, `Liberation Mono`, `Noto Mono` or `Ubuntu Mono`. – noobninja Jan 15 '20 at 23:16
  • 1
    +1 Excellent. Only command line one that worked for me. – copper.hat Nov 02 '20 at 00:13
64

You can add the following as an example to your ~/.Xresources file:

! Use a truetype font and size.
xterm*faceName: Monospace
xterm*faceSize: 14

Then run the following:

xrdb -merge ~/.Xresources
nazmul idris
  • 741
  • 5
  • 4
  • 13
    Should be the accepted solution imo. Thanks. – Adham Zahran Apr 16 '20 at 15:19
  • 6
    Indeed the best answer, since is enable TrueType fonts. I came to the same after reading this page: [XTerm introduction and TrueType fonts configuration](http://www.futurile.net/2016/06/14/xterm-setup-and-truetype-font-configuration/) – Hibou57 Jun 04 '20 at 16:47
  • Only this worked on Ubuntu 22.04 – subin Sep 12 '22 at 15:25
50

You can also Ctrl-Right mouse click for temporary change of font size

Ev Dolzhenko
  • 4,259
  • 1
  • 14
  • 5
  • 3
    How do you find out what font size and face you have actually selected with this method, so you can make it the default in ~/.Xresources ? – Geeb Nov 13 '17 at 18:00
  • 3
    @Geeb you can find out which font corresponds to which menu entry with `appres XTerm | grep -i utf8font` – Matija Nalis Nov 10 '18 at 15:52
13

From messing with /etc/X11/app-defaults/XTerm file and man page for Xterm I found two methods.

Method 1: A simpler method but not permanent: hold Ctrl key and right click button. This should bring up a menu for VT fonts, which stays on only as long as you hold right click key. You should see 7 choices, the largest being huge, which is what I'm using because my vision isn't exactly good.

Source: xterm(1) man page, part VT Fonts, which states "The fontMenu pops up when when the “control” key and pointer button three are pressed in a window."

Method 2: Permanent. Look through /etc/X11/app-defaults/XTerm, find what sizes lines such as *VT100.font1: , choose one, and write somewhere xterm*font: 10x20 (10x20 , again this is my choice for reasons I already stated).

About my system: I'm running Ubuntu 13.10

Lii
  • 53
  • 6
Sergiy Kolodyazhnyy
  • 103,293
  • 19
  • 273
  • 492
  • 1
    Didn't notice that dolzenko has already posted method 1 before. Oh, well. – Sergiy Kolodyazhnyy Aug 06 '14 at 08:37
  • 2
    And method 2, changing system files, is not recommended. You (and all users on your system) may loose your modifications any time when an update overwrites that file. – Dirk Aug 23 '16 at 15:59
9

One more option, add this to your ~/.Xresources to make hotkeys for changing the font size:

XTerm.vt100.translations: #override \n\
  Ctrl <Key> minus: smaller-vt-font() \n\
  Ctrl <Key> plus: larger-vt-font()

If you use uxterm, be sure to use UXTerm.vt100.translations instead.

Then you can use ctrl++ to increase font size or ctrl+- to decrease the size, just like you can with ctrl+right-click and selecting one of the other font size options.

Matthew
  • 201
  • 2
  • 3
3

you can also simply test them with :

xterm -fn "--clean--*---*---*---*-*"

after sel with xfontsel

Frederik Spang
  • 1,072
  • 2
  • 11
  • 35
pat
  • 31
  • 1
3

Creating the .Xresources file with specified lines of code (provided in the answer by noffle) fixed my issue, but on reboot the settings got lost again.

If the settings specified in the .Xresource file are not getting reflected automatically, try adding the below line to ~/.bashrc.

[[ -f ~/.Xresources ]] && xrdb -merge ~/.Xresources
Zanna
  • 69,223
  • 56
  • 216
  • 327
Jerin
  • 131
  • 2