XTerm font is very small. How can I set it larger?
-
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 Answers
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 ~/.Xresourcesin 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.
- 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
-
3The 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
-
6You'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
-
-
-
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
Use -fa and -fs parameters:
xterm -fa 'Monospace' -fs 14
- 1,130
- 9
- 7
-
4
-
-
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
-
3To 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
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
- 741
- 5
- 4
-
13
-
6Indeed 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
-
You can also Ctrl-Right mouse click for temporary change of font size
- 4,259
- 1
- 14
- 5
-
3How 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
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
- 53
- 6
- 103,293
- 19
- 273
- 492
-
1Didn't notice that dolzenko has already posted method 1 before. Oh, well. – Sergiy Kolodyazhnyy Aug 06 '14 at 08:37
-
2And 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
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.
- 201
- 2
- 3
you can also simply test them with :
xterm -fn "--clean--*---*---*---*-*"
after sel with xfontsel
- 1,072
- 2
- 11
- 35
- 31
- 1
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
-
2This should probably be a comment instead (on the answer you mention) – Nonny Moose Jan 13 '18 at 01:43