XTerm font is very small. How can I set it larger?
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 ~/.Xresources
in a terminal
All new xterm
s 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.
-
Thanks noffle it worked....but how can i set the dimensions of the xterm windows to a fixed ones?– SudoJul 10, 2012 at 9:32
-
3The X resource for dimensions is
geometry
. So something like the following in your.Xresources
would work:xterm*geometry: 110x50
.– noffleJul 10, 2012 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.– noffleJul 10, 2012 at 17:06
-
-
5
xterm: cannot load font '*-fixed-*-*-*-38-*'
Warning: Shell widget "xterm" has an invalid geometry specification: "*-fixed-*-*-*-38-*"
Apr 20, 2018 at 17:53
Use -fa and -fs parameters:
xterm -fa 'Monospace' -fs 14
-
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 findMonospace
to be using excessive amounts of anti-aliasing which makes it looks blurry when viewed next to anxterm
window using the default font.– kasperdJan 9, 2019 at 10:34 -
3To list monospaced
xterm
fonts:fc-list | cut -f2 -d: | sort -u | grep -i Mono
. If you prefer sans fonts, tryDejaVu Sans Mono
,Liberation Mono
,Noto Mono
orUbuntu Mono
. Jan 15, 2020 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
-
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– Hibou57Jun 4, 2020 at 16:47
-
You can also Ctrl-Right mouse click for temporary change of font size
-
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 ?– GeebNov 13, 2017 at 18:00
-
3@Geeb you can find out which font corresponds to which menu entry with
appres XTerm | grep -i utf8font
Nov 10, 2018 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
-
1Didn't notice that dolzenko has already posted method 1 before. Oh, well. Aug 6, 2014 at 8: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.– DirkAug 23, 2016 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.
you can also simply test them with :
xterm -fn "--clean--*---*---*---*-*"
after sel with xfontsel
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) Jan 13, 2018 at 1:43